diff options
author | Jesse Gross <jesse@nicira.com> | 2010-11-08 13:23:01 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 13:33:29 -0800 |
commit | 1b7cd15c8c89f5c26dc525d985e45c9bd9265fe2 (patch) | |
tree | 64f060d8b13586a7df0984dd1d91134ce43f7f44 /net/8021q | |
parent | 70d5f4e7ddb91da21169629548b763cc1244c374 (diff) |
vlan: Avoid hwaccel vlan packets when vid not used.
[This patch applies only to 2.6.36 stable. The problem was introduced
in that release and is already fixed by larger changes to the vlan
code in 2.6.37.]
Normally hardware accelerated vlan packets are quickly dropped if
there is no corresponding vlan device configured. The one exception
is promiscuous mode, where we allow all of these packets through so
they can be picked up by tcpdump. However, this behavior causes a
crash if we actually try to receive these packets. This fixes that
crash by ignoring packets with vids not corresponding to a configured
device in the vlan hwaccel routines and then dropping them before they
get to consumers in the network stack.
Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Nikola Ciprich <extmaillist@linuxbox.cz>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: David Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 0eb96f7e44be..2dcff0be8acb 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c @@ -43,6 +43,9 @@ int vlan_hwaccel_do_receive(struct sk_buff *skb) struct net_device *dev = skb->dev; struct vlan_rx_stats *rx_stats; + if (unlikely(!is_vlan_dev(dev))) + return 0; + skb->dev = vlan_dev_info(dev)->real_dev; netif_nit_deliver(skb); |