mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-27 09:12:32 +00:00
369ff2a001
Issue #1974.
20 lines
631 B
Diff
20 lines
631 B
Diff
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
|
|
index 66b3ab9..a17f054 100644
|
|
--- a/drivers/net/usb/smsc95xx.c
|
|
+++ b/drivers/net/usb/smsc95xx.c
|
|
@@ -1730,7 +1730,13 @@ static int smsc95xx_reset_resume(struct usb_interface *intf)
|
|
|
|
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);
|
|
}
|