[ovs-dev] [PATCH 12/17] nx-match: Use nx_put_header() internally for encoding flow matches.

Ben Pfaff blp at nicira.com
Wed Oct 1 00:26:19 UTC 2014


On Tue, Sep 30, 2014 at 09:04:26AM +0900, YAMAMOTO Takashi wrote:
> > This will make it easier to support 64-bit OXM experimenter fields.
> > 
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> 
> >  static void
> > -nxm_put_ipv6(struct ofpbuf *b, uint32_t header,
> > +nxm_put_ipv6(struct ofpbuf *b,
> > +             enum mf_field_id field, enum ofp_version version,
> >               const struct in6_addr *value, const struct in6_addr *mask)
> >  {
> > -    if (ipv6_mask_is_any(mask)) {
> > -        return;
> > -    } else if (ipv6_mask_is_exact(mask)) {
> > -        nxm_put_header(b, header);
> > -        ofpbuf_put(b, value, sizeof *value);
> > -    } else {
> > -        nxm_put_header(b, nxm_make_wild_header(header));
> > -        ofpbuf_put(b, value, sizeof *value);
> > -        ofpbuf_put(b, mask, sizeof *mask);
> > -    }
> > +    nxm_put(b, field, version, value, mask, sizeof *value);
> >  }
> 
> i prefer to use ->s6_addr when using it as raw bytes.
> not a fault of this patch, though.

That is reasonable.  I will make that change for v2.

> Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>

Thanks!


More information about the dev mailing list