genode/repos/dde_linux/patches/csum.patch
Norman Feske ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00

19 lines
581 B
Diff

diff -r d30e545c9a57 drivers/net/usb/smsc95xx.c
--- a/drivers/net/usb/smsc95xx.c Mon Apr 22 16:19:09 2013 +0200
+++ b/drivers/net/usb/smsc95xx.c Mon Apr 22 16:19:46 2013 +0200
@@ -1714,7 +1714,13 @@
static void smsc95xx_rx_csum_offload(struct sk_buff *skb)
{
- skb->csum = *(u16 *)(skb_tail_pointer(skb) - 2);
+ /*
+ * Use bytewise access to avoid alignment issues on packets that have none
+ * aligned sizes
+ */
+ char *tail = skb_tail_pointer(skb);
+ skb->csum = (*(tail - 2) << 8) | *(tail - 1);
+
skb->ip_summed = CHECKSUM_COMPLETE;
skb_trim(skb, skb->len - 2);
}