[ovs-dev] [PATCH 4/5] Use VLAN_PCP_SHIFT consistently, instead of open-coding "13".

Ben Pfaff blp at nicira.com
Fri Feb 12 14:17:25 PST 2010


Reported-by: Jesse Gross <jesse at nicira.com>
---
 datapath/actions.c |    2 +-
 lib/dpif-netdev.c  |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/datapath/actions.c b/datapath/actions.c
index 8b32de4..cb29a99 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -92,7 +92,7 @@ modify_vlan_tci(struct datapath *dp, struct sk_buff *skb,
 		mask = VLAN_VID_MASK;
 		key->dl_vlan = htons(tci & mask);
 	} else {
-		tci = a->vlan_pcp.vlan_pcp << 13;
+		tci = a->vlan_pcp.vlan_pcp << VLAN_PCP_SHIFT;
 		mask = VLAN_PCP_MASK;
 	}
 
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 2fd2bed..1bd8112 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -1273,8 +1273,9 @@ dp_netdev_execute_actions(struct dp_netdev *dp,
             break;
 
 		case ODPAT_SET_VLAN_PCP:
-			dp_netdev_modify_vlan_tci(packet, key, a->vlan_pcp.vlan_pcp << 13,
-                                      VLAN_PCP_MASK);
+			dp_netdev_modify_vlan_tci(
+                packet, key, a->vlan_pcp.vlan_pcp << VLAN_PCP_SHIFT,
+                VLAN_PCP_MASK);
             break;
 
 		case ODPAT_STRIP_VLAN:
-- 
1.6.6.1





More information about the dev mailing list