[ovs-dev] [PATCH] Use initializers for struct ofputil_flow_mod instead of assignments.

Ben Pfaff blp at ovn.org
Mon Jan 4 20:26:12 UTC 2016


On Mon, Jan 04, 2016 at 02:30:11PM -0500, Russell Bryant wrote:
> On 01/04/2016 02:24 PM, Ben Pfaff wrote:
> > A few bugs have been fixed lately that were related to struct
> > ofputil_flow_mod not being fully initialized in a few places.  This commit
> > changes several pieces of code from using individual assignments to fields
> > in struct ofputil_flow_mod, to using whole initializers or assignments to
> > a whole struct.  This should help prevent similar problems in the future.
> > 
> > CC: Ilya Maximets <i.maximets at samsung.com>
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> 
> Acked-by: Russell Bryant <russell at ovn.org>
> 
> I'd be tempted to remove the initializations of fields to 0 now that
> they don't matter, but I guess it doesn't hurt anything to leave them

I thought about that (and removed a few) but as long as you're pointing
it out too I might as well remove them.

I left a few where it seemed like they clarified things, e.g. initialize
table_id to 0 and priority to 0 for an flow_mod that adds a flow to
table 0 with priority 0.

I applied this to master.  Thanks for the review!



More information about the dev mailing list