Skip to content

Commit

Permalink
netfilter: nft_reject_bridge: enable reject with bridge vlan
Browse files Browse the repository at this point in the history
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 <michael-dev@fami-braun.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Michael Braun authored and Pablo Neira Ayuso committed May 25, 2020
1 parent 98790bb commit e9c284e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/bridge/netfilter/nft_reject_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb,
ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source);
eth->h_proto = eth_hdr(oldskb)->h_proto;
skb_pull(nskb, ETH_HLEN);

if (skb_vlan_tag_present(oldskb)) {
u16 vid = skb_vlan_tag_get(oldskb);

__vlan_hwaccel_put_tag(nskb, oldskb->vlan_proto, vid);
}
}

static int nft_bridge_iphdr_validate(struct sk_buff *skb)
Expand Down

0 comments on commit e9c284e

Please sign in to comment.