[ovs-dev] [PATCH v3 ovn 1/2] Add RDNSS support to OVN

Ben Pfaff blp at ovn.org
Fri Oct 25 18:27:23 UTC 2019


On Fri, Oct 25, 2019 at 11:51:42PM +0530, Numan Siddique wrote:
> On Fri, Oct 25, 2019 at 11:15 PM Ben Pfaff <blp at ovn.org> wrote:
> 
> > On Fri, Oct 25, 2019 at 03:45:49PM +0200, Lorenzo Bianconi wrote:
> > > +/* RDNSS option RFC 6106 */
> > > +#define ND_RDNSS_OPT_LEN    8
> > > +#define ND_OPT_RDNSS        25
> > > +struct nd_rdnss_opt {
> > > +    uint8_t type;         /* ND_OPT_RDNSS. */
> > > +    uint8_t len;          /* >= 3. */
> > > +    ovs_be16 reserved;    /* Always 0. */
> > > +    ovs_16aligned_be32 lifetime;
> > > +    const ovs_be128 dns[0];
> > > +};
> > > +BUILD_ASSERT_DECL(ND_RDNSS_OPT_LEN == sizeof(struct nd_rdnss_opt));
> >
> > This structure is a little odd.  The use of ovs_16aligned_be32 implies
> > that it can be 16-bit aligned, but ovs_be128 implies that it must be
> > 64-bit aligned.
> >
> 
> Would it work if we remove ovs_be128 from the struct and then when adding
> this option
> to the IPv6 RA packet, copy the IPv6 address directly to dp_packet buffer ?

That seems fine.

If the addresses are going at the end of the buffer, you can use
dp_packet_put() to append them directly.

> How ever if you think we need to have ovs_16aligned_be128 type, does it
> makes sense to add this
> structure and corresponding function - packet_put_ra_rdnss_opt to
> lib/packets.c of ovs repo ?

ovs_16aligned_be128 would probably go naturally in openvswitch/types.h
in OVS, alongside the other similar types.


More information about the dev mailing list