ofproto-dpif: Fix uninitialized struct member in xlate_actions().
authorBen Pfaff <blp@nicira.com>
Mon, 24 Oct 2011 16:58:35 +0000 (09:58 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 24 Oct 2011 17:49:33 +0000 (10:49 -0700)
commit97e42c92a9b7d4642f0df49d217c3c2f782175f9
tree6331a99022ace599e064d80ee62af5c9e854202b
parent023e1e0a4d0a9f6937d9a2c66ba30d502029c4df
ofproto-dpif: Fix uninitialized struct member in xlate_actions().

Commit 7257b535ab "Implement new fragment handling policy." moved around
a bunch of initialization code in xlate_actions() so that the assignment
to ctx->flow.tp_src and .tp_dst would not have to also assign to
ctx->base_flow.tp_src and .tp_dst.  However, this meant that the early-exit
"return" in the new switch statement exited without initializing a lot of
the context.  In particular 'may_set_up_flow' didn't get initialized, so
something the early-exit would produce a flow that couldn't be installed,
which wasn't the intent.

It seems that this optimization was a bad tradeoff, so this commit puts
all of the initialization up front and just assigns to both copies of the
tp_src and tp_dst members.

Fixes a nondeterministic "make check" failure in the VLAN handling test.
ofproto/ofproto-dpif.c