Skip to content

Commit

Permalink
vlan: dont drop packets from unknown vlans in promiscuous mode
Browse files Browse the repository at this point in the history
Roger Luethi noticed packets for unknown VLANs getting silently dropped
even in promiscuous mode.

Check for promiscuous mode in __vlan_hwaccel_rx() and vlan_gro_common()
before drops.

As suggested by Patrick, mark such packets to have skb->pkt_type set to
PACKET_OTHERHOST to make sure they are dropped by IP stack.

Reported-by: Roger Luethi <rl@hellgate.ch>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 1, 2010
1 parent 9262919 commit 173e79f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions net/8021q/vlan_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,

if (vlan_dev)
skb->dev = vlan_dev;
else if (vlan_id)
goto drop;
else if (vlan_id) {
if (!(skb->dev->flags & IFF_PROMISC))
goto drop;
skb->pkt_type = PACKET_OTHERHOST;
}

return (polling ? netif_receive_skb(skb) : netif_rx(skb));

Expand Down Expand Up @@ -102,8 +105,11 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,

if (vlan_dev)
skb->dev = vlan_dev;
else if (vlan_id)
goto drop;
else if (vlan_id) {
if (!(skb->dev->flags & IFF_PROMISC))
goto drop;
skb->pkt_type = PACKET_OTHERHOST;
}

for (p = napi->gro_list; p; p = p->next) {
NAPI_GRO_CB(p)->same_flow =
Expand Down

0 comments on commit 173e79f

Please sign in to comment.