]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: vlan: allow matching vlan id insider 802.1ad frame
authorFlorian Westphal <fw@strlen.de>
Thu, 1 Apr 2021 14:08:43 +0000 (16:08 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 3 Apr 2021 11:55:49 +0000 (13:55 +0200)
This makes "ether type 0x88a8 vlan id 342" work.

Before this change, nft would still insert a dependency on 802.1q so the
rule would never match.

Signed-off-by: Florian Westphal <fw@strlen.de>
src/proto.c

index b75626df2861e47cba1eae8d0379d0bfad5158d7..b6466f8b65d4644dd2d494b6b0d61f8398052c9e 100644 (file)
@@ -1027,6 +1027,7 @@ const struct proto_desc proto_vlan = {
                PROTO_LINK(__constant_htons(ETH_P_ARP),         &proto_arp),
                PROTO_LINK(__constant_htons(ETH_P_IPV6),        &proto_ip6),
                PROTO_LINK(__constant_htons(ETH_P_8021Q),       &proto_vlan),
+               PROTO_LINK(__constant_htons(ETH_P_8021AD),      &proto_vlan),
 
        },
        .templates      = {
@@ -1099,6 +1100,7 @@ const struct proto_desc proto_eth = {
                PROTO_LINK(__constant_htons(ETH_P_ARP),         &proto_arp),
                PROTO_LINK(__constant_htons(ETH_P_IPV6),        &proto_ip6),
                PROTO_LINK(__constant_htons(ETH_P_8021Q),       &proto_vlan),
+               PROTO_LINK(__constant_htons(ETH_P_8021AD),      &proto_vlan),
        },
        .templates      = {
                [ETHHDR_DADDR]          = ETHHDR_ADDR("daddr", ether_dhost),
@@ -1124,6 +1126,7 @@ const struct proto_desc proto_netdev = {
                PROTO_LINK(__constant_htons(ETH_P_ARP),         &proto_arp),
                PROTO_LINK(__constant_htons(ETH_P_IPV6),        &proto_ip6),
                PROTO_LINK(__constant_htons(ETH_P_8021Q),       &proto_vlan),
+               PROTO_LINK(__constant_htons(ETH_P_8021AD),      &proto_vlan),
        },
        .templates      = {
                [0]     = PROTO_META_TEMPLATE("protocol", &ethertype_type, NFT_META_PROTOCOL, 16),