On Tue, Jul 31, 2018 at 10:22 AM, Justin Pettit <[email protected]> wrote:
> > > On Jul 16, 2018, at 7:39 PM, Darrell Ball <[email protected]> wrote: > > > > diff --git a/lib/flow.c b/lib/flow.c > > index 76a8b9a..e84a40d 100644 > > --- a/lib/flow.c > > +++ b/lib/flow.c > > @@ -453,9 +453,14 @@ invalid: > > return true; > > } > > > > +/* datap points to the first extension header and advances as parsing > > + * occurs; sizep is the remaining size and is decreased accordingly. > > + * nw_proto starts as the first extension header to process and is > > + * updated as the extension headers are parsed. */ > > static inline bool > > parse_ipv6_ext_hdrs__(const void **datap, size_t *sizep, uint8_t > *nw_proto, > > - uint8_t *nw_frag) > > + uint8_t *nw_frag, > > + const struct ovs_16aligned_ip6_frag **frag_hdr) > > I think this comment could use some more explanation. Does the following > seem correct? > > /* Parses IPv6 extenstion headers until a terminal header (or header we > * don't understand) is found. 'datap' points to the first extension > * header and advances as parsing occurs; 'sizep' is the remaining size > * and is decreased accordingly. 'nw_proto' starts as the first > * extension header to process and is updated as the extension headers > * are parsed. > * > * If a fragment header is found, '*frag_hdr' is set to the fragment > * header. If it is the first fragment, extension header parsing > * otherwise continues as usual. If it's not the first fragment, > * 'nw_proto' is set to IPPROTO_FRAGMENT and 'nw_frag' has > * FLOW_NW_FRAG_ANY set. Additionally, if it's not the first fragment > * and there are more fragments, 'nw_frag' will also have > * FLOW_NW_FRAG_LATER set. */ > > Also, I think this should go with parse_ipv6_ext_hdrs(), since it's the > public function. > Thanks for adding more explanation I made a few modifications and moved to public API. /* Parses IPv6 extension headers until a terminal header (or header we * don't understand) is found. 'datap' points to the first extension * header and advances as parsing occurs; 'sizep' is the remaining size * and is decreased accordingly. 'nw_proto' starts as the first * extension header to process and is updated as the extension headers * are parsed. * * If a fragment header is found, '*frag_hdr' is set to the fragment * header. If it is the first fragment, extension header parsing * otherwise continues as usual. If it's not the first fragment, * 'nw_proto' is set to IPPROTO_FRAGMENT and 'nw_frag' has * FLOW_NW_FRAG_LATER set. Both first and later fragments have * FLOW_NW_FRAG_ANY set in 'nw_frag'. */ bool *parse_ipv6_ext_hdrs*(*const* *void* **datap, size_t *sizep, uint8_t *nw_proto, uint8_t *nw_frag, *const* *struct* ovs_16aligned_ip6_frag **frag_hdr) I folded into V9 as well. > > If you go agree with all of this, I'll go ahead and make the changes > myself. > > --Justin > > > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
