summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-04-02 12:54:53 +0200
committerFlorian Westphal <fw@strlen.de>2021-04-03 13:55:53 +0200
commit751336b7bffea4065bcd9f895eef3159addaba3e (patch)
tree841cccb108c75c53427cd84fb30c8ce3da3d2116 /src
parente9e4c3c9092fdb447f13573f176b1c337f8efc4f (diff)
proto: replace vlan ether type with 8021q
Previous patches added "8021ad" mnemonic for IEEE 802.1AD frame type. This adds the 8021q shorthand for the existing 'vlan' frame type. nft will continue to recognize 'ether type vlan', but listing will now print 8021q. Adjust all test cases accordingly. Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src')
-rw-r--r--src/proto.c5
-rw-r--r--src/scanner.l1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/proto.c b/src/proto.c
index 67c519be..63727605 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -1057,8 +1057,11 @@ static const struct symbol_table ethertype_tbl = {
SYMBOL("ip", __constant_htons(ETH_P_IP)),
SYMBOL("arp", __constant_htons(ETH_P_ARP)),
SYMBOL("ip6", __constant_htons(ETH_P_IPV6)),
- SYMBOL("vlan", __constant_htons(ETH_P_8021Q)),
+ SYMBOL("8021q", __constant_htons(ETH_P_8021Q)),
SYMBOL("8021ad", __constant_htons(ETH_P_8021AD)),
+
+ /* for compatibility with older versions */
+ SYMBOL("vlan", __constant_htons(ETH_P_8021Q)),
SYMBOL_LIST_END
},
};
diff --git a/src/scanner.l b/src/scanner.l
index 9eb79d2d..a9232db8 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -423,6 +423,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
"pcp" { return PCP; }
}
"8021ad" { yylval->string = xstrdup(yytext); return STRING; }
+"8021q" { yylval->string = xstrdup(yytext); return STRING; }
"arp" { scanner_push_start_cond(yyscanner, SCANSTATE_ARP); return ARP; }
<SCANSTATE_ARP>{