[ovs-dev] [PATCH v2] IGMPv3 support

Thadeu Lima de Souza Cascardo cascardo at redhat.com
Thu Jun 11 12:42:01 UTC 2015


On Thu, Jun 11, 2015 at 12:41:42AM -0300, Flavio Leitner wrote:
> > > > +
> > > > +    offset = p->l4_ofs;
> > > 
> > > The above could be like this:
> > > offset = dp_packet_l4(p) - dp_packet_data(p)
> > > to avoid accessing internals of dp_packet.
> > > 
> > 
> > That's how it originally was written, but I thought that using it like
> > this would protect the code against l4_ofs being UINT16_MAX, and
> > dp_packet_l4 returning NULL.
> > 
> > Any thoughs on that? Should I just check for dp_packet_l4 returning NULL?
> 
> The UINT16_MAX is reserved and means not set.
> see dp_packet_reset_offsets()
> 
> [...]

I know, but may I just assume that it must have been set since in order to get to
this point, a flow has already been extracted from the packet?

Cascardo.



More information about the dev mailing list