[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

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;

Xen-devel mailing list



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