From patchwork Sun Jun 6 23:35:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jussi Kivilinna X-Patchwork-Id: 54822 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9A94BB7D97 for ; Mon, 7 Jun 2010 09:45:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836Ab0FFXpH (ORCPT ); Sun, 6 Jun 2010 19:45:07 -0400 Received: from sinikuusama.dnainternet.net ([83.102.40.134]:49995 "EHLO sinikuusama.dnainternet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752432Ab0FFXpF (ORCPT ); Sun, 6 Jun 2010 19:45:05 -0400 X-Greylist: delayed 571 seconds by postgrey-1.27 at vger.kernel.org; Sun, 06 Jun 2010 19:45:05 EDT Received: from localhost (localhost [127.0.0.1]) by sinikuusama.dnainternet.net (Postfix) with ESMTP id C46232C611; Mon, 7 Jun 2010 02:35:31 +0300 (EEST) X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: -1.36 X-Spam-Level: X-Spam-Status: No, score=-1.36 tagged_above=-9999 required=6 tests=[ALL_TRUSTED=-1.36] Received: from sinikuusama.dnainternet.net ([83.102.40.134]) by localhost (sinikuusama.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id S1IyBL8AwN5H; Mon, 7 Jun 2010 02:35:31 +0300 (EEST) Received: from kirsikkapuu.dnainternet.net (kirsikkapuu.dnainternet.net [83.102.40.214]) by sinikuusama.dnainternet.net (Postfix) with ESMTP id A2F372C608; Mon, 7 Jun 2010 02:35:31 +0300 (EEST) Received: from fate.lan (dyn2-212-50-133-228.psoas.suomi.net [212.50.133.228]) by kirsikkapuu.dnainternet.net (Postfix) with ESMTP id 8B41A7F00A; Mon, 7 Jun 2010 02:35:31 +0300 (EEST) Subject: [PATCH] asix: check packet size against mtu+ETH_HLEN instead of ETH_FRAME_LEN To: "David S. Miller" From: Jussi Kivilinna Cc: netdev@vger.kernel.org, David Hollis Date: Mon, 07 Jun 2010 02:35:31 +0300 Message-ID: <20100606233531.23585.10292.stgit@fate.lan> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. Signed-off-by: Jussi Kivilinna --- drivers/net/usb/asix.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 7e797ed..aea4645 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c @@ -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;