cb3ef99029c751d94a8bcc22bd4f4299f8ee7db0
[openwrt/openwrt.git] /
1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Wed, 24 Mar 2021 02:30:42 +0100
3 Subject: [PATCH] netfilter: flowtable: add bridge vlan filtering support
4
5 Add the vlan tag based when PVID is set on.
6
7 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 ---
9
10 --- a/net/netfilter/nft_flow_offload.c
11 +++ b/net/netfilter/nft_flow_offload.c
12 @@ -111,6 +111,18 @@ static void nft_dev_path_info(const stru
13 if (is_zero_ether_addr(info->h_source))
14 memcpy(info->h_source, path->dev->dev_addr, ETH_ALEN);
15
16 + switch (path->bridge.vlan_mode) {
17 + case DEV_PATH_BR_VLAN_TAG:
18 + info->encap[info->num_encaps].id = path->bridge.vlan_id;
19 + info->encap[info->num_encaps].proto = path->bridge.vlan_proto;
20 + info->num_encaps++;
21 + break;
22 + case DEV_PATH_BR_VLAN_UNTAG:
23 + info->num_encaps--;
24 + break;
25 + case DEV_PATH_BR_VLAN_KEEP:
26 + break;
27 + }
28 info->xmit_type = FLOW_OFFLOAD_XMIT_DIRECT;
29 break;
30 default: