diff options
author | Florian Westphal <fw@strlen.de> | 2021-03-25 10:34:40 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-03-25 12:40:30 +0100 |
commit | ead6345cb4ab23f3277155a611483edace536a46 (patch) | |
tree | 90fa090361abf639b24470253a905725c93c40f3 /src | |
parent | a3e215d7f68f41556912c33b3dcf12781f6b9b59 (diff) |
parser: fix scope closure of COUNTER token
It is closed after allocation, which is too early: this
stopped 'packets' and 'bytes' from getting parsed correctly.
Also add a test case for this.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/parser_bison.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index ca64141e..abe11781 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -2692,7 +2692,7 @@ stateful_stmt_list : stateful_stmt } ; -stateful_stmt : counter_stmt +stateful_stmt : counter_stmt close_scope_counter | limit_stmt | quota_stmt | connlimit_stmt @@ -2792,11 +2792,11 @@ connlimit_stmt : CT COUNT NUM close_scope_ct counter_stmt : counter_stmt_alloc | counter_stmt_alloc counter_args -counter_stmt_alloc : COUNTER close_scope_counter +counter_stmt_alloc : COUNTER { $$ = counter_stmt_alloc(&@$); } - | COUNTER NAME stmt_expr close_scope_counter + | COUNTER NAME stmt_expr { $$ = objref_stmt_alloc(&@$); $$->objref.type = NFT_OBJECT_COUNTER; |