[patch 03/12] sky2: fix VLAN receive processing

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>, Krzysztof Oledzki <olel@...>, Greg KH <greg@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, <torvalds@...>, <akpm@...>, <alan@...>, <netdev@...>, Pierre-Yves Ritschard <pyr@...>, Stephen Hemminger <shemminger@...>
Date: Monday, October 8, 2007 - 2:06 pm

From: Stephen Hemminger <shemminger@linux-foundation.org>

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 <pyr@spootnik.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 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)

-- 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/12] 2.6.22.10 -stable review, Greg KH, (Mon Oct 8, 2:05 pm)
Re: [patch 00/12] 2.6.22.10 -stable review, Greg KH, (Mon Oct 8, 2:09 pm)
[patch 09/12] Fix SMP poweroff hangs, Greg KH, (Mon Oct 8, 2:06 pm)
Re: [patch 09/12] Fix SMP poweroff hangs, Olof Johansson, (Tue Oct 9, 11:17 am)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Thomas Gleixner, (Tue Oct 9, 7:21 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Linus Torvalds, (Tue Oct 9, 7:27 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Paul Mackerras, (Wed Oct 10, 8:24 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Olof Johansson, (Tue Oct 9, 8:03 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Thomas Gleixner, (Tue Oct 9, 7:35 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Linus Torvalds, (Wed Oct 10, 1:29 am)
[patch 06/12] Fix ppp_mppe kernel stack usage., Greg KH, (Mon Oct 8, 2:06 pm)
[patch 05/12] libata: update drive blacklists, Greg KH, (Mon Oct 8, 2:06 pm)
[patch 03/12] sky2: fix VLAN receive processing, Greg KH, (Mon Oct 8, 2:06 pm)