mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 15:02:25 +00:00
19 lines
581 B
Diff
19 lines
581 B
Diff
diff -r c094ecb374e9 drivers/net/usb/smsc95xx.c
|
|
--- a/drivers/net/usb/smsc95xx.c Thu Apr 11 15:47:15 2013 +0200
|
|
+++ b/drivers/net/usb/smsc95xx.c Thu Apr 11 15:52:01 2013 +0200
|
|
@@ -1747,7 +1747,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);
|
|
}
|