Skip to contentSkip to conversation

parser_bison: recursive table declaration in deprecated meter statement

PATCH New Pablo Neira Ayuso 1 participant 1 message Jul 4, 2024 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 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")

---
To be applied before:
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/

 src/parser_bison.y | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
src/parser_bison.y +4 -16
index f3f71801643d..6b167080cd93 100644
@@ -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(&@$);
Signature · 1 line
2.30.2