Skip to content

Commit e9c284e

Browse files
michael-devummakynes
authored andcommitted
netfilter: nft_reject_bridge: enable reject with bridge vlan
Currently, using the bridge reject target with tagged packets results in untagged packets being sent back. Fix this by mirroring the vlan id as well. Fixes: 85f5b30 ("netfilter: bridge: add reject support") Signed-off-by: Michael Braun <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 98790bb commit e9c284e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/bridge/netfilter/nft_reject_bridge.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb,
3131
ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source);
3232
eth->h_proto = eth_hdr(oldskb)->h_proto;
3333
skb_pull(nskb, ETH_HLEN);
34+
35+
if (skb_vlan_tag_present(oldskb)) {
36+
u16 vid = skb_vlan_tag_get(oldskb);
37+
38+
__vlan_hwaccel_put_tag(nskb, oldskb->vlan_proto, vid);
39+
}
3440
}
3541

3642
static int nft_bridge_iphdr_validate(struct sk_buff *skb)

0 commit comments

Comments
 (0)