From b96193cded7a3de731670cd40e9d5b03ae5a682d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 15 Apr 2009 10:47:52 -0700 Subject: [PATCH] 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. --- vswitchd/bridge.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.30.2