From 32c60c27ac0665bea6da7974550cf6db3f19ce0f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 15 Apr 2009 10:50:08 -0700 Subject: [PATCH] datapath: Set only VID when adding a new header with ODPAT_SET_VLAN_VID. ODPAT_SET_VLAN_VID is supposed to set only the VID field of the VLAN header. When it was only modifying an existing VLAN header, it was doing this correctly. However, when it added a new header, it added all of the bits passed in as the argument, not just the VID field. Fix this, setting the other bits to 0 implicitly. Also fixes the analogous problem with ODPAT_SET_VLAN_PCP. --- datapath/actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/actions.c b/datapath/actions.c index 717c0582..17527931 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -80,7 +80,7 @@ modify_vlan_tci(struct sk_buff *skb, struct odp_flow_key *key, * xxx version. We'll directly use the software version * xxx until the problem can be diagnosed. */ - skb = __vlan_put_tag(skb, tci); + skb = __vlan_put_tag(skb, tci & mask); if (!skb) return NULL; vh = vlan_eth_hdr(skb); -- 2.30.2