Skip to contentSkip to conversation

asix: check packet size against mtu+ETH_HLEN instead of ETH_FRAME_LEN

PATCH Applied Jussi Kivilinna 2 participants 2 messages Jun 6, 2010 – Jun 7, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 asix: check packet size against mtu+ETH_HLEN instead of ETH_FRAME_LEN

Driver checks received packet is too large in asix_rx_fixup() and fails if it is. Problem is that MTU might be set larger than 1500 and asix fails to work correctly with VLAN tagged packets. The check should be 'dev->net->mtu + ETH_HLEN' instead.

Tested with AX88772.

---
 drivers/net/usb/asix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/usb/asix.c +1 -1
index 7e797ed..aea4645 100644
@@ -344,7 +344,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 			return 2;
 		}
 
-		if (size > ETH_FRAME_LEN) {
+		if (size > dev->net->mtu + ETH_HLEN) {
 			netdev_err(dev->net, "asix_rx_fixup() Bad RX Length %d\n",
 				   size);
 			return 0;
maintainer Applied
#1 lore raw

From: Jussi Kivilinna <[email protected]>
Date: Mon, 07 Jun 2010 02:35:31 +0300

Quoted 7 lines

Driver checks received packet is too large in asix_rx_fixup() and fails if it is. Problem is that MTU might be set larger than 1500 and asix fails to work correctly with VLAN tagged packets. The check should be 'dev->net->mtu + ETH_HLEN' instead.

Tested with AX88772.

Applied, thanks.