Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4fd93ee authored by Devdutt Patnaik's avatar Devdutt Patnaik Committed by Azhar Shaikh
Browse files

net: usb: ax88179_178a: Fix handling of IP header alignment



Asix mini-driver passes incorrect skb->len to usbnet due to
incorrect handling of IP alignment pseudo-header.
Fix updates to skb->len by correctly performing skb_pull by
NET_IP_ALIGN bytes.

Change-Id: I92ec4631875fd3ab7d1f20c947084ab2fa187555
Signed-off-by: default avatarDevdutt Patnaik <dpatnaik@codeaurora.org>
parent 6dfb56e0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1394,8 +1394,8 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)

		if (pkt_cnt == 0) {
			/* Skip IP alignment psudo header */
			skb_pull(skb, 2);
			skb->len = pkt_len;
			skb_pull(skb, NET_IP_ALIGN);
			skb_set_tail_pointer(skb, pkt_len);
			skb->truesize = pkt_len + sizeof(struct sk_buff);
			ax88179_rx_checksum(skb, pkt_hdr);
@@ -1405,7 +1405,7 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
		ax_skb = skb_clone(skb, GFP_ATOMIC);
		if (ax_skb) {
			ax_skb->len = pkt_len;
			ax_skb->data = skb->data + 2;
			skb_pull(ax_skb, NET_IP_ALIGN);
			skb_set_tail_pointer(ax_skb, pkt_len);
			ax_skb->truesize = pkt_len + sizeof(struct sk_buff);
			ax88179_rx_checksum(ax_skb, pkt_hdr);