]> git.baikalelectronics.ru Git - kernel.git/commit
xen-netfront: reset skb network header before checksum
authorWei Liu <wei.liu2@citrix.com>
Wed, 19 Feb 2014 18:48:34 +0000 (18:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Feb 2014 21:52:51 +0000 (16:52 -0500)
commit2d514fa9c22c411aeff1ff9f762a14cc62812e53
tree20ad85f098f0d2592648fa9cde6ff1bc909b59d9
parentd6e6561c8b539d6644b923b1dcc6601ee2246b0f
xen-netfront: reset skb network header before checksum

In 69b52aa18 ("net: add skb_checksum_setup") we introduced some checksum
functions in core driver. Subsequent change d45f3ca77 ("xen-netfront:
use new skb_checksum_setup function") made use of those functions to
replace its own implementation.

However with that change netfront is broken. It sees a lot of checksum
error. That's because its own implementation of checksum function was a
bit hacky (dereferencing skb->data directly) while the new function was
implemented using ip_hdr(). The network header is not reset before skb
is passed to the new function. When the new function tries to do its
job, it's confused and reports error.

The fix is simple, we need to reset network header before passing skb to
checksum function. Netback is not affected as it already does the right
thing.

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Tested-By: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netfront.c