bridge: Verify that a vlan is allowed to egress on given port
When bridge forwards a frame, make sure that a frame is allowed to egress on that port. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
a37b85c9fb
commit
85f46c6bae
@@ -35,6 +35,16 @@ static int br_pass_frame_up(struct sk_buff *skb)
|
||||
brstats->rx_bytes += skb->len;
|
||||
u64_stats_update_end(&brstats->syncp);
|
||||
|
||||
/* Bridge is just like any other port. Make sure the
|
||||
* packet is allowed except in promisc modue when someone
|
||||
* may be running packet capture.
|
||||
*/
|
||||
if (!(brdev->flags & IFF_PROMISC) &&
|
||||
!br_allowed_egress(br, br_get_vlan_info(br), skb)) {
|
||||
kfree_skb(skb);
|
||||
return NET_RX_DROP;
|
||||
}
|
||||
|
||||
indev = skb->dev;
|
||||
skb->dev = brdev;
|
||||
|
||||
|
Reference in New Issue
Block a user