Skip to content

Commit

Permalink
xen-netfront: reset skb network header before checksum
Browse files Browse the repository at this point in the history
In ed1f50c ("net: add skb_checksum_setup") we introduced some checksum
functions in core driver. Subsequent change b5cf66c ("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>
  • Loading branch information
Wei Liu authored and David S. Miller committed Feb 19, 2014
1 parent c89b5c6 commit d554f73
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/xen-netfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ static int handle_incoming_queue(struct net_device *dev,

/* Ethernet work: Delayed to here as it peeks the header. */
skb->protocol = eth_type_trans(skb, dev);
skb_reset_network_header(skb);

if (checksum_setup(dev, skb)) {
kfree_skb(skb);
Expand Down

0 comments on commit d554f73

Please sign in to comment.