[ovs-dev] [PATCH 8/9] XXX Fix segfault in clone action.

Ben Pfaff blp at ovn.org
Mon Dec 5 07:17:45 UTC 2016


Without this patch, the clone action segfaults in the OVN test cases
in the following commit.

This is not a correct fix.  It screws up some of the purpose of clone,
although it is still fine for OVN.
---
 ofproto/ofproto-dpif-xlate.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index b534b31..99cb5b3 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -4293,29 +4293,15 @@ static void
 compose_clone_action(struct xlate_ctx *ctx,
                     const struct ofpact_clone *oc)
 {
-    struct flow old_flow, old_base_flow;
-    size_t actions_offset;
-    size_t sample_offset = nl_msg_start_nested(ctx->odp_actions,
-                                               OVS_ACTION_ATTR_SAMPLE);
-
-    /* Ensure that any prior actions are applied. */
-    xlate_commit_actions(ctx);
+    struct flow old_flow;
 
     /* clone might change the flow key, store the original. */
     old_flow = ctx->xin->flow;
-    old_base_flow = ctx->base_flow;
 
-    /* Sample with 100% Probability */
-    nl_msg_put_u32(ctx->odp_actions, OVS_SAMPLE_ATTR_PROBABILITY, UINT32_MAX);
-    actions_offset = nl_msg_start_nested(ctx->odp_actions,
-                                         OVS_SAMPLE_ATTR_ACTIONS);
     do_xlate_actions(oc->actions, ofpact_clone_get_action_len(oc), ctx);
-    nl_msg_end_nested(ctx->odp_actions, actions_offset);
-    nl_msg_end_nested(ctx->odp_actions, sample_offset);
 
     /* restore flow key */
     ctx->xin->flow = old_flow;
-    ctx->base_flow = old_base_flow;
 }
 
 static bool
-- 
2.10.2



More information about the dev mailing list