diff options
author | Florian Westphal <fw@strlen.de> | 2021-03-11 14:23:07 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-03-16 23:59:42 +0100 |
commit | 7ae67aafa8a86b9a66bf9cb102ea551e33d243cf (patch) | |
tree | 35163e5cd42d213ef1e787f326c3a2bd17ab5619 /src/parser_bison.y | |
parent | 8e006bb06f1bf07fb042b8d52ae6ae5bb54f38ae (diff) |
scanner: arp: move to own scope
allows to move the arp specific tokens out of the INITIAL scope.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 9cfa3366..a22f61c4 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -861,6 +861,7 @@ opt_newline : NEWLINE | /* empty */ ; +close_scope_arp : { scanner_pop_start_cond(nft->scanner, PARSER_SC_ARP); }; close_scope_ct : { scanner_pop_start_cond(nft->scanner, PARSER_SC_CT); }; close_scope_eth : { scanner_pop_start_cond(nft->scanner, PARSER_SC_ETH); }; close_scope_fib : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_FIB); }; @@ -2431,7 +2432,7 @@ family_spec : /* empty */ { $$ = NFPROTO_IPV4; } family_spec_explicit : IP close_scope_ip { $$ = NFPROTO_IPV4; } | IP6 close_scope_ip6 { $$ = NFPROTO_IPV6; } | INET { $$ = NFPROTO_INET; } - | ARP { $$ = NFPROTO_ARP; } + | ARP close_scope_arp { $$ = NFPROTO_ARP; } | BRIDGE { $$ = NFPROTO_BRIDGE; } | NETDEV { $$ = NFPROTO_NETDEV; } ; @@ -4544,7 +4545,7 @@ keyword_expr : ETHER close_scope_eth { $$ = symbol_value(&@$, "ether"); } | IP close_scope_ip { $$ = symbol_value(&@$, "ip"); } | IP6 close_scope_ip6 { $$ = symbol_value(&@$, "ip6"); } | VLAN { $$ = symbol_value(&@$, "vlan"); } - | ARP { $$ = symbol_value(&@$, "arp"); } + | ARP close_scope_arp { $$ = symbol_value(&@$, "arp"); } | DNAT { $$ = symbol_value(&@$, "dnat"); } | SNAT { $$ = symbol_value(&@$, "snat"); } | ECN { $$ = symbol_value(&@$, "ecn"); } @@ -5104,7 +5105,7 @@ vlan_hdr_field : ID { $$ = VLANHDR_VID; } | TYPE { $$ = VLANHDR_TYPE; } ; -arp_hdr_expr : ARP arp_hdr_field +arp_hdr_expr : ARP arp_hdr_field close_scope_arp { $$ = payload_expr_alloc(&@$, &proto_arp, $2); } |