netvsc: fix incorrect receive checksum offloading
commit027ab3b8ee5a1dcb7d0f61175b3fb0d0a8afe0f0
authorStephen Hemminger <sthemmin@microsoft.com>
Mon, 24 Oct 2016 04:32:47 +0000 (23 21:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Nov 2016 06:48:53 +0000 (15 07:48 +0100)
treef3f45f9680b5ad060aac927dc30b6173ed21355b
parentb75edf27a6c3ea4f6ef4fd6e5497cf0de1733e1b
netvsc: fix incorrect receive checksum offloading

[ Upstream commit e52fed7177f74382f742c27de2cc5314790aebb6 ]

The Hyper-V netvsc driver was looking at the incorrect status bits
in the checksum info. It was setting the receive checksum unnecessary
flag based on the IP header checksum being correct. The checksum
flag is skb is about TCP and UDP checksum status. Because of this
bug, any packet received with bad TCP checksum would be passed
up the stack and to the application causing data corruption.
The problem is reproducible via netcat and netem.

This had a side effect of not doing receive checksum offload
on IPv6. The driver was also also always doing checksum offload
independent of the checksum setting done via ethtool.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hyperv/netvsc_drv.c