From: Ben Pfaff Date: Wed, 15 Apr 2009 17:47:52 +0000 (-0700) Subject: vswitch: Strip VLAN headers correctly. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b96193cded7a3de731670cd40e9d5b03ae5a682d;p=openvswitch vswitch: Strip VLAN headers correctly. When a packet comes in on a trunk port and goes out on an implicit VLAN port, we are supposed to strip the VLAN header (because it is implicit). We were not doing so; instead, we were setting the VLAN field to all-1s. Strip it properly, instead. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index c88d8cf6..eed105c2 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1550,8 +1550,12 @@ compose_actions(struct bridge *br, const flow_t *flow, uint16_t vlan, for (p = dsts; p < &dsts[n_dsts]; p++) { union odp_action *a; if (p->vlan != cur_vlan) { - a = odp_actions_add(actions, ODPAT_SET_VLAN_VID); - a->vlan_vid.vlan_vid = htons(p->vlan); + if (p->vlan == OFP_VLAN_NONE) { + odp_actions_add(actions, ODPAT_STRIP_VLAN); + } else { + a = odp_actions_add(actions, ODPAT_SET_VLAN_VID); + a->vlan_vid.vlan_vid = htons(p->vlan); + } cur_vlan = p->vlan; } a = odp_actions_add(actions, ODPAT_OUTPUT);