On Wed, Jan 08, 2014 at 01:22:25PM -0800, Pravin Shelar wrote: > On Fri, Dec 27, 2013 at 8:03 PM, Ben Pfaff <b...@nicira.com> wrote: > > This is analogous to the split between rule and rule_actions in > > ofproto. As there, it will allow retaining a reference to a rule's > > actions, while processing them, without having to retain a reference > > to the rule itself. > > > > Signed-off-by: Ben Pfaff <b...@nicira.com>
... > > if (actions) { > > - free(state->actions); > > - state->actions = xmemdup(netdev_flow->actions, > > - netdev_flow->actions_len); > > + dp_netdev_actions_unref(state->actions); > > + state->actions = NULL; > > > > - *actions = state->actions; > > - *actions_len = netdev_flow->actions_len; > > + if (actions) { > > + state->actions = dp_netdev_actions_ref(netdev_flow->actions); > > + *actions = state->actions->actions; > > + *actions_len = state->actions->size; > > + } > actions is checked twice. > > Otherwise looks good. Thanks for pointing that out. I changed this code to: if (actions) { dp_netdev_actions_unref(state->actions); state->actions = dp_netdev_actions_ref(netdev_flow->actions); *actions = state->actions->actions; *actions_len = state->actions->size; } _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev