[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CCC1D7E@AcuExch.aculab.com>
Date: Mon, 11 Jan 2016 10:09:55 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Edward Cree' <ecree@...arflare.com>,
David Miller <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-net-drivers@...arflare.com" <linux-net-drivers@...arflare.com>,
"tom@...bertland.com" <tom@...bertland.com>,
"alexander.duyck@...il.com" <alexander.duyck@...il.com>
Subject: RE: [PATCH net-next 6/8] net: gre: Implement LCO for GRE over IPv4
From: Edward Cree
> Sent: 08 January 2016 19:47
...
> + if (skb->ip_summed == CHECKSUM_PARTIAL) {
> + csum = csum_fold(lco_csum(skb));
> + if (csum == 0)
> + csum = CSUM_MANGLED_0;
> + return csum;
> + } else {
> + return csum_fold(skb_checksum(skb, 0, skb->len, 0));
> + }
You see to be worried about csum_fold() returning 0 in one
path, but not in the other.
I'm guessing that 0 can only happen if all the bytes that have
been checksummed are zero.
This is almost certainly never true if any bytes have been summed,
and might be better avoided by initialising any such checksum to
0xffff (instead of 0) much earlier on.
David
Powered by blists - more mailing lists