[ovs-dev] [PATCH 1/2] datapath: fix a bug in SF_FLOW_KEY_PUT macro
Andy Zhou
azhou at nicira.com
Mon Jul 29 19:35:50 UTC 2013
Yes indeed. Will add to this patch.
On Mon, Jul 29, 2013 at 9:46 AM, Jesse Gross <jesse at nicira.com> wrote:
> On Sat, Jul 27, 2013 at 10:27 PM, Andy Zhou <azhou at nicira.com> wrote:
> > This bug will cause mask values to corrupt the flow key value. So far
> > the bug has not showed up because we don't write mask value when
> > there is no mask Netlink attributes. However, it needs to be fixed for
> > the next and future commits where we will start to set default
> > values for key and mask for missing Netlink attributes.
> >
> > Signed-off-by: Andy Zhou <azhou at nicira.com>
> > ---
> > datapath/flow.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/datapath/flow.c b/datapath/flow.c
> > index 2c11408..ba775f4 100644
> > --- a/datapath/flow.c
> > +++ b/datapath/flow.c
> > @@ -82,8 +82,9 @@ static void update_range__(struct sw_flow_match *match,
> > do { \
> > update_range__(match, offsetof(struct sw_flow_key,
> field), \
> > sizeof((match)->key->field),
> is_mask); \
> > - if (is_mask && match->mask != NULL) {
> \
> > - (match)->mask->key.field = value;
> \
> > + if (is_mask) {
> \
> > + if ((match)->mask)
> \
> > + (match)->mask->key.field = value;
> \
>
> Shouldn't we also do this for the memcpy variant?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130729/b907d65b/attachment-0003.html>
More information about the dev
mailing list