Skip to content

Commit

Permalink
netfilter: flowtable: add bridge vlan filtering support
Browse files Browse the repository at this point in the history
Add the vlan tag based when PVID is set on.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Mar 24, 2021
1 parent 4cd91f7 commit e990cef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions net/netfilter/nft_flow_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ static void nft_dev_path_info(const struct net_device_path_stack *stack,
if (is_zero_ether_addr(info->h_source))
memcpy(info->h_source, path->dev->dev_addr, ETH_ALEN);

switch (path->bridge.vlan_mode) {
case DEV_PATH_BR_VLAN_TAG:
info->encap[info->num_encaps].id = path->bridge.vlan_id;
info->encap[info->num_encaps].proto = path->bridge.vlan_proto;
info->num_encaps++;
break;
case DEV_PATH_BR_VLAN_UNTAG:
info->num_encaps--;
break;
case DEV_PATH_BR_VLAN_KEEP:
break;
}
info->xmit_type = FLOW_OFFLOAD_XMIT_DIRECT;
break;
default:
Expand Down

0 comments on commit e990cef

Please sign in to comment.