From: Ben Pfaff Date: Wed, 15 Apr 2009 17:50:08 +0000 (-0700) Subject: datapath: Set only VID when adding a new header with ODPAT_SET_VLAN_VID. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32c60c27ac0665bea6da7974550cf6db3f19ce0f;p=openvswitch 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. --- 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);