]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofproto-dpif-xlate: Make clone save "was_mpls".
authorBen Pfaff <blp@ovn.org>
Fri, 6 Jan 2017 00:11:15 +0000 (16:11 -0800)
committerBen Pfaff <blp@ovn.org>
Tue, 10 Jan 2017 18:39:04 +0000 (10:39 -0800)
This seems like it's an optimization rather than a correctness issue, but
in general it's best to make "clone" like patch ports where there is no
reason to depart from its design, since we know that patch ports work well.

Reported-by: Mickey Spiegel <mickeys.dev@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html
Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
Tested-by: Dong Jun <dongj@dtdream.com>
ofproto/ofproto-dpif-xlate.c

index 56a2552b3dd1fcb843475887432c2f0df084d60d..0e273cc1bfcc5feb7776ac3a58709b5dc0f4121f 100644 (file)
@@ -4315,6 +4315,7 @@ xlate_sample_action(struct xlate_ctx *ctx,
 static void
 compose_clone_action(struct xlate_ctx *ctx, const struct ofpact_nest *oc)
 {
+    bool old_was_mpls = ctx->was_mpls;
     bool old_conntracked = ctx->conntracked;
     struct flow old_flow = ctx->xin->flow;
 
@@ -4341,6 +4342,10 @@ compose_clone_action(struct xlate_ctx *ctx, const struct ofpact_nest *oc)
     /* The clone's conntrack execution should have no effect on the original
      * packet. */
     ctx->conntracked = old_conntracked;
+
+    /* Popping MPLS from the clone should have no effect on the original
+     * packet. */
+    ctx->was_mpls = old_was_mpls;
 }
 
 static bool