[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9AAE0902D5BC7E449B7C8E4E778ABCD0196259@AMSPEX01CL01.citrite.net>
Date: Fri, 29 Nov 2013 10:32:13 +0000
From: Paul Durrant <Paul.Durrant@...rix.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: "xen-devel@...ts.xen.org" <xen-devel@...ts.xen.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Wei Liu <wei.liu2@...rix.com>,
Ian Campbell <Ian.Campbell@...rix.com>,
David Vrabel <david.vrabel@...rix.com>
Subject: RE: [PATCH net v2] xen-netback: fix fragment detection in checksum
setup
> -----Original Message-----
> From: Eric Dumazet [mailto:eric.dumazet@...il.com]
> Sent: 28 November 2013 17:29
> To: Paul Durrant
> Cc: xen-devel@...ts.xen.org; netdev@...r.kernel.org; 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
Powered by blists - more mailing lists