summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-06-27 02:34:17 +0200
committerFlorian Westphal <fw@strlen.de>2017-09-27 20:02:37 +0200
commit50537e9e67622acff7d40e495f8d106162f3e38e (patch)
tree843e155788ade9d56ca480c5376e1310040451db /src/parser_bison.y
parentdb3ffc6eba301a93387d999d5c10e3b9e75d7660 (diff)
bison: permit keywords in list_stmt_expressions
'ct event set label' and 'ct event set new or label' work, but 'ct event set new, label' did not: nft add rule filter input ct event set new,label Error: syntax error, unexpected label This changes the definition to also contain keyword symbol expressions. Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index ce6a77a8..11f4716a 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -609,8 +609,8 @@ static void location_update(struct location *loc, struct location *rhs, int n)
%type <expr> rhs_expr concat_rhs_expr basic_rhs_expr
%destructor { expr_free($$); } rhs_expr concat_rhs_expr basic_rhs_expr
-%type <expr> primary_rhs_expr list_rhs_expr shift_rhs_expr
-%destructor { expr_free($$); } primary_rhs_expr list_rhs_expr shift_rhs_expr
+%type <expr> primary_rhs_expr list_rhs_expr shift_rhs_expr symbol_stmt_expr
+%destructor { expr_free($$); } primary_rhs_expr list_rhs_expr shift_rhs_expr symbol_stmt_expr
%type <expr> and_rhs_expr exclusive_or_rhs_expr inclusive_or_rhs_expr
%destructor { expr_free($$); } and_rhs_expr exclusive_or_rhs_expr inclusive_or_rhs_expr
@@ -3302,14 +3302,17 @@ ct_key_dir_optional : BYTES { $$ = NFT_CT_BYTES; }
| ZONE { $$ = NFT_CT_ZONE; }
;
+symbol_stmt_expr : symbol_expr
+ | keyword_expr
+ ;
-list_stmt_expr : symbol_expr COMMA symbol_expr
+list_stmt_expr : symbol_stmt_expr COMMA symbol_stmt_expr
{
$$ = list_expr_alloc(&@$);
compound_expr_add($$, $1);
compound_expr_add($$, $3);
}
- | list_stmt_expr COMMA symbol_expr
+ | list_stmt_expr COMMA symbol_stmt_expr
{
$1->location = @$;
compound_expr_add($1, $3);