ok, I will update patch according to comments.

On Wed, Nov 21, 2012 at 11:32 AM, Jesse Gross <[email protected]> wrote:

> On Tue, Nov 20, 2012 at 5:59 PM, Pravin B Shelar <[email protected]>
> wrote:
> > diff --git a/lib/match.c b/lib/match.c
> > index 81b7173..c3187d3 100644
> > --- a/lib/match.c
> > +++ b/lib/match.c
> > @@ -62,14 +62,17 @@ match_wc_init(struct match *match, const struct flow
> *flow)
> >          }
> >      }
> >
> > -    if (flow->tunnel.ip_dst || flow->tunnel.tun_id) {
> > +    if (flow->tunnel.tun_id) {
> >          memset(&wc->masks.tunnel.tun_id, 0xff, sizeof
> wc->masks.tunnel.tun_id);
> > +    }
> > +    if (flow->tunnel.ip_dst) {
> >          memset(&wc->masks.tunnel.ip_src, 0xff, sizeof
> wc->masks.tunnel.ip_src);
> >          memset(&wc->masks.tunnel.ip_dst, 0xff, sizeof
> wc->masks.tunnel.ip_dst);
> >          memset(&wc->masks.tunnel.flags, 0xff, sizeof
> wc->masks.tunnel.flags);
> >          memset(&wc->masks.tunnel.ip_tos, 0xff, sizeof
> wc->masks.tunnel.ip_tos);
> >          memset(&wc->masks.tunnel.ip_ttl, 0xff, sizeof
> wc->masks.tunnel.ip_ttl);
> >      }
>
> For the flow->tunnel.ip_dst case I think we should use the key bit in
> the flags to decide whether to mask the tun_id or not, rather than
> falling back to the old tun_id != 0.
>
> > +static void
> > +flow_tunnel_format(const struct match *match, struct ds *s)
> > +{
> > +    const struct flow_wildcards *wc = &match->wc;
> > +    const struct flow_tnl *tnl = &match->flow.tunnel;
> > +
> > +    switch (wc->masks.tunnel.tun_id) {
> > +    case 0:
> > +        return;
>
> If tun_id is completely masked out then I think we want to skip
> printing it but still move on to the other fields.
>
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to