[ovs-dev] [PATCHv2 1/2] dpif: Support fetching flow mask via dpif_flow_get().

Ben Pfaff blp at nicira.com
Thu Jul 3 23:53:52 UTC 2014


On Thu, Jul 03, 2014 at 12:29:25PM +1200, Joe Stringer wrote:
> Change the interface to allow implementations to pass back a buffer, and
> allow callers to specify which of actions, mask, and stats they wish to
> receive. This will be used in the next commit.
> 
> Signed-off-by: Joe Stringer <joestringer at nicira.com>

I think that dpif_flow_get() should set *bufp to NULL before it calls
->flow_get.  Otherwise I think that the error case could end up
freeing an indeterminate pointer in some cases, e.g. what if
dpif_netdev_flow_get() returns the error obtained from
dpif_netdev_flow_from_nlattrs()?

I think that dpif_netdev_flow_get() has a couple of bugs.  First, if
the actions are big enough that they expand the ofpbuf, and a caller
asks for the mask also, then adding the actions will invalidate *maskp
and *mask_len.  Second, ofpbuf_put() should be used instead of
ofpbuf_push(), otherwise the actions will *always* invalidate the mask
;-(

Thanks,

Ben.



More information about the dev mailing list