[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH net v2] xen-netback: fix fragment detection in checksum setup



> -----Original Message-----
> From: Eric Dumazet [mailto:eric.dumazet@xxxxxxxxx]
> Sent: 28 November 2013 17:29
> To: Paul Durrant
> Cc: xen-devel@xxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; Wei Liu; Ian Campbell;
> David Vrabel
> Subject: Re: [PATCH net v2] xen-netback: fix fragment detection in checksum
> setup
> 
> On Thu, 2013-11-28 at 13:23 +0000, Paul Durrant wrote:
> > The code to detect fragments in checksum_setup() was missing for IPv4
> and
> > too eager for IPv6. (It transpires that Windows seems to send IPv6 packets
> > with a fragment header even if they are not a fragment - i.e. offset is 
> > zero,
> > and M bit is not set).
> 
> > +   /* 3fff -> fragment offset != 0 OR more fragments */
> > +   if (ntohs(iph->frag_off) & 0x3fff)
> > +           fragment = true;
> > +
> 
> What about the more self documented and faster :
> 
> if (iph->frag_off & htons(IP_OFFSET | IP_MF))
>       fragment = true;
> 

Nicer definitely. I'll need to add the equivalent def for IP6_OFFSET to use the 
same style of test there.

Thanks,

  Paul
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.