Track vlan-id correctly. So that we can use that information for
composing optimized action set.

---
 ofproto/ofproto-dpif.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index bd976f7..cef37a6 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3758,13 +3758,15 @@ compose_actions(struct action_xlate_ctx *ctx, uint16_t 
vlan,
     cur_vlan = initial_vlan;
     for (dst = set.dsts; dst < &set.dsts[set.n]; dst++) {
         if (dst->vlan == initial_vlan) {
+            ctx->base_flow.vlan_tci = ctx->flow.vlan_tci;
             continue;
         }
         if (dst->vlan != cur_vlan) {
+            ovs_be16 tci;
             if (dst->vlan == OFP_VLAN_NONE) {
                 nl_msg_put_flag(ctx->odp_actions, OVS_ACTION_ATTR_POP_VLAN);
+                tci = htons(0);
             } else {
-                ovs_be16 tci;
 
                 if (cur_vlan != OFP_VLAN_NONE) {
                      nl_msg_put_flag(ctx->odp_actions, 
OVS_ACTION_ATTR_POP_VLAN);
@@ -3775,6 +3777,7 @@ compose_actions(struct action_xlate_ctx *ctx, uint16_t 
vlan,
                                 OVS_ACTION_ATTR_PUSH_VLAN, tci);
             }
             cur_vlan = dst->vlan;
+            ctx->base_flow.vlan_tci = tci;
         }
         nl_msg_put_u32(ctx->odp_actions,
                        OVS_ACTION_ATTR_OUTPUT, dst->port->odp_port);
-- 
1.7.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to