]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.22.10/sky2-vlan-len.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 2.6.22.10 / sky2-vlan-len.patch
1 From shemminger@linux-foundation.org Fri Sep 28 09:52:14 2007
2 From: Stephen Hemminger <shemminger@linux-foundation.org>
3 Date: Fri, 28 Sep 2007 09:48:13 -0700
4 Subject: sky2: fix VLAN receive processing
5 To: Krzysztof Oledzki <olel@ans.pl>, Greg KH <greg@kroah.com>
6 Cc: stable@kernel.org, netdev@vger.kernel.org, Pierre-Yves Ritschard <pyr@spootnik.org>
7 Message-ID: <20070928164858.539587428@linux-foundation.org>
8 Content-Disposition: inline; filename=sky2-vlan-len.patch
9
10 From: Stephen Hemminger <shemminger@linux-foundation.org>
11
12 Already upstream.
13
14 The length check for truncated frames was not correctly handling
15 the case where VLAN acceleration had already read the tag.
16 Also, the Yukon EX has some features that use high bit of status
17 as security tag.
18
19 Signed-off-by: Pierre-Yves Ritschard <pyr@spootnik.org>
20 Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23 ---
24 drivers/net/sky2.c | 9 ++++++++-
25 1 file changed, 8 insertions(+), 1 deletion(-)
26
27 --- a/drivers/net/sky2.c
28 +++ b/drivers/net/sky2.c
29 @@ -2049,6 +2049,7 @@ static struct sk_buff *sky2_receive(stru
30 struct sky2_port *sky2 = netdev_priv(dev);
31 struct rx_ring_info *re = sky2->rx_ring + sky2->rx_next;
32 struct sk_buff *skb = NULL;
33 + u16 count;
34
35 if (unlikely(netif_msg_rx_status(sky2)))
36 printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n",
37 @@ -2063,7 +2064,13 @@ static struct sk_buff *sky2_receive(stru
38 if (!(status & GMR_FS_RX_OK))
39 goto resubmit;
40
41 - if (status >> 16 != length)
42 + count = (status & GMR_FS_LEN) >> 16;
43 +#ifdef SKY2_VLAN_TAG_USED
44 + /* Account for vlan tag */
45 + if (sky2->vlgrp && (status & GMR_FS_VLAN))
46 + count -= VLAN_HLEN;
47 +#endif
48 + if (count != length)
49 goto len_mismatch;
50
51 if (length < copybreak)