From d42c4f8dc1d39dcc1f102b56f63e4c128a2d767b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 12 Feb 2010 13:54:19 -0800 Subject: [PATCH] Use VLAN_PCP_SHIFT consistently, instead of open-coding "13". Reported-by: Jesse Gross --- 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 8b32de47..cb29a998 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 2fd2bed3..1bd81125 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: -- 2.30.2