Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756622AbXJHSLT (ORCPT ); Mon, 8 Oct 2007 14:11:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753130AbXJHSLF (ORCPT ); Mon, 8 Oct 2007 14:11:05 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:51776 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752654AbXJHSLC (ORCPT ); Mon, 8 Oct 2007 14:11:02 -0400 Date: Mon, 8 Oct 2007 11:06:11 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org, Krzysztof Oledzki , Greg KH Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, netdev@vger.kernel.org, Pierre-Yves Ritschard , Stephen Hemminger Subject: [patch 03/12] sky2: fix VLAN receive processing Message-ID: <20071008180611.GD7627@kroah.com> References: <20071008180406.052382073@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="sky2-vlan-len.patch" In-Reply-To: <20071008180551.GA7627@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1559 Lines: 49 From: Stephen Hemminger Already upstream. The length check for truncated frames was not correctly handling the case where VLAN acceleration had already read the tag. Also, the Yukon EX has some features that use high bit of status as security tag. Signed-off-by: Pierre-Yves Ritschard Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman --- drivers/net/sky2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -2049,6 +2049,7 @@ static struct sk_buff *sky2_receive(stru struct sky2_port *sky2 = netdev_priv(dev); struct rx_ring_info *re = sky2->rx_ring + sky2->rx_next; struct sk_buff *skb = NULL; + u16 count; if (unlikely(netif_msg_rx_status(sky2))) printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n", @@ -2063,7 +2064,13 @@ static struct sk_buff *sky2_receive(stru if (!(status & GMR_FS_RX_OK)) goto resubmit; - if (status >> 16 != length) + count = (status & GMR_FS_LEN) >> 16; +#ifdef SKY2_VLAN_TAG_USED + /* Account for vlan tag */ + if (sky2->vlgrp && (status & GMR_FS_VLAN)) + count -= VLAN_HLEN; +#endif + if (count != length) goto len_mismatch; if (length < copybreak) -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/