summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-07-03 00:08:01 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-07-05 00:10:47 +0200
commita70a217079ef83482fc093d8549f8cdeaeaa3cae (patch)
tree0cf496b0a76b7a1d98b8297b3ae32866e8bea269
parent8047086e454f5696c1686fea98a32e1fe3e65f90 (diff)
parser_bison: recursive table declaration in deprecated meter statement
This is allowing for recursive table NAME declarations such as: ... table xyz1 table xyz2 { ... } remove it. Fixes: 3ed5e31f4a32 ("src: add flow statement") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/parser_bison.y20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index f3f71801..6b167080 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -4212,10 +4212,11 @@ map_stmt : set_stmt_op set_ref_expr '{' set_elem_expr_stmt COLON set_elem_expr_
}
;
-meter_stmt : flow_stmt_legacy_alloc flow_stmt_opts '{' meter_key_expr stmt '}'
+meter_stmt : flow_stmt_legacy_alloc TABLE identifier '{' meter_key_expr stmt '}'
{
- $1->meter.key = $4;
- $1->meter.stmt = $5;
+ $1->meter.name = $3;
+ $1->meter.key = $5;
+ $1->meter.stmt = $6;
$$->location = @$;
$$ = $1;
}
@@ -4228,19 +4229,6 @@ flow_stmt_legacy_alloc : FLOW
}
;
-flow_stmt_opts : flow_stmt_opt
- {
- $<stmt>$ = $<stmt>0;
- }
- | flow_stmt_opts flow_stmt_opt
- ;
-
-flow_stmt_opt : TABLE identifier
- {
- $<stmt>0->meter.name = $2;
- }
- ;
-
meter_stmt_alloc : METER identifier '{' meter_key_expr stmt '}'
{
$$ = meter_stmt_alloc(&@$);