Use VLAN_PCP_SHIFT consistently, instead of open-coding "13".
authorBen Pfaff <blp@nicira.com>
Fri, 12 Feb 2010 21:54:19 +0000 (13:54 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 12 Feb 2010 21:56:15 +0000 (13:56 -0800)
Reported-by: Jesse Gross <jesse@nicira.com>
datapath/actions.c
lib/dpif-netdev.c

index 8b32de47c398fb50d5a5cf0159353b721269d939..cb29a998bd53b92c97ac427448f64edfa0a27b4a 100644 (file)
@@ -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;
        }
 
index 2fd2bed3788a16182a82b599a45113a8c811ed43..1bd811255019d9e92b684ecde001cd4622f8b361 100644 (file)
@@ -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: