The kernel returns flow stats and actions to userspace on flow deletion.
By not initializing the odp_flow's "actions" or "n_actions" members we
caused it to use whatever happened to be in that space on the stack, which
caused random memory corruption.
(There is no need to initialize the "stats" member, since it is not read,
only written, by the kernel, but by doing so we quiet valgrind.)
if (super != sub->super) {
if (!super) {
struct odp_flow odp_flow;
+ memset(&odp_flow.stats, 0, sizeof odp_flow.stats);
odp_flow.key = sub->cr.flow;
+ odp_flow.actions = NULL;
+ odp_flow.n_actions = 0;
dpif_flow_del(&p->dpif, &odp_flow);
classifier_remove(&p->cls, &sub->cr);
rule_destroy(sub);