From: Justin Pettit Date: Thu, 26 Jun 2008 18:44:30 +0000 (-0700) Subject: Fix a couple of problems when modifying VLAN tags. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df5df460f09fb8d885ccbf7802402f66431d4149;p=openvswitch Fix a couple of problems when modifying VLAN tags. --- diff --git a/switch/datapath.c b/switch/datapath.c index aa1cb802..12bb7144 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -952,12 +952,12 @@ modify_vlan(struct buffer *buffer, uint16_t new_id = a->arg.vlan_id; struct vlan_eth_header *veh; - if (new_id != OFP_VLAN_NONE) { + if (new_id != htons(OFP_VLAN_NONE)) { if (key->flow.dl_vlan != htons(OFP_VLAN_NONE)) { /* Modify vlan id, but maintain other TCI values */ veh = buffer->l2; veh->veth_tci &= ~htons(VLAN_VID); - veh->veth_tci |= htons(new_id); + veh->veth_tci |= new_id; } else { /* Insert new vlan id. */ struct eth_header *eh = buffer->l2;