vswitch: Strip VLAN headers correctly.
authorBen Pfaff <blp@nicira.com>
Wed, 15 Apr 2009 17:47:52 +0000 (10:47 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 15 Apr 2009 17:47:52 +0000 (10:47 -0700)
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

index c88d8cf6d4498ebe0eb973cf4f4c64c281daf9dc..eed105c20ea1965c5dc06b76d3c15727d1d4b915 100644 (file)
@@ -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);