summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2021-11-16 12:08:15 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2021-11-16 12:08:15 +0100
commit54b65608f59b5c979cb912b4f774bb1767764e45 (patch)
tree75f0e288d361dbda86304d96a24f2e6d6f86c96f /src/parser_bison.y
parentc96b22b105d1005a170d4ad8f64aebab1c40eb21 (diff)
parser: allow for string raw payload base
Remove new 'ih' token, allow to represent the raw payload base with a string instead. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index eb89a589..81d75ecb 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -318,7 +318,6 @@ int nft_lex(void *, void *, void *);
%token LL_HDR "ll"
%token NETWORK_HDR "nh"
%token TRANSPORT_HDR "th"
-%token INNER_HDR "ih"
%token BRIDGE "bridge"
@@ -5261,7 +5260,17 @@ payload_raw_expr : AT payload_base_spec COMMA NUM COMMA NUM
payload_base_spec : LL_HDR { $$ = PROTO_BASE_LL_HDR; }
| NETWORK_HDR { $$ = PROTO_BASE_NETWORK_HDR; }
| TRANSPORT_HDR { $$ = PROTO_BASE_TRANSPORT_HDR; }
- | INNER_HDR { $$ = PROTO_BASE_INNER_HDR; }
+ | STRING
+ {
+ if (!strcmp($1, "ih")) {
+ $$ = PROTO_BASE_INNER_HDR;
+ } else {
+ erec_queue(error(&@1, "unknown raw payload base"), state->msgs);
+ xfree($1);
+ YYERROR;
+ }
+ xfree($1);
+ }
;
eth_hdr_expr : ETHER eth_hdr_field close_scope_eth