[ovs-dev] [PATCH 2/2] odp-util: Always serialize tunnel mask attributes.

Andy Zhou azhou at nicira.com
Fri Aug 2 03:14:11 UTC 2013


This is a good solution. Thanks.


On Thu, Aug 1, 2013 at 6:58 PM, Jesse Gross <jesse at nicira.com> wrote:

> On Thu, Aug 1, 2013 at 4:39 PM, Andy Zhou <azhou at nicira.com> wrote:
> > acked-by: Andy Zhou <azhou at nicira.com>
> >
> >
> > On Thu, Aug 1, 2013 at 4:17 PM, Jesse Gross <jesse at nicira.com> wrote:
> >>
> >> A tunnel value attribute is not allowed to have an empty IP destination
> >> address but this is legal for masks. This drops both the checks for
> >> serializing masks and also the sanity checks on them.
> >>
> >> Signed-off-by: Jesse Gross <jesse at nicira.com>
> >> ---
> >>  datapath/flow.c | 5 ++++-
> >>  lib/odp-util.c  | 2 +-
> >>  2 files changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/datapath/flow.c b/datapath/flow.c
> >> index ebe8fb3..457d123 100644
> >> --- a/datapath/flow.c
> >> +++ b/datapath/flow.c
> >> @@ -1248,6 +1248,9 @@ int ipv4_tun_from_nlattr(const struct nlattr
> *attr,
> >>                 return -EINVAL;
> >>         }
> >>
> >> +       if (is_mask)
> >> +               return 0;
> >> +
> >
> > This change works. How about make the ttl check only apply to key,  like
> > ipv4_dst, so we don't have a normal return from the middle of the
> function?
>
> The problem with that check is that it runs during both key and mask
> processing. The that makes the order of processing significant because
> if the mask were to be run first then it would legitimately find a
> zero. I changed this so the key tests are wrapped in the !is_mask
> check, so there's only one return statement.
>
> Thanks for the reviews, I'll push these two patches shortly.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130801/d7c27434/attachment-0003.html>


More information about the dev mailing list