Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft] parser_bison: recursive table declaration in deprecated meter statement
Date: Fri,  5 Jul 2024 00:11:29 +0200	[thread overview]
Message-ID: <20240704221129.357335-1-pablo@netfilter.org> (raw)

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>
---
To be applied before:
https://patchwork.ozlabs.org/project/netfilter-devel/patch/20240704220554.277702-1-pablo@netfilter.org/

 src/parser_bison.y | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index f3f71801643d..6b167080cd93 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(&@$);
-- 
2.30.2


                 reply	other threads:[~2024-07-04 22:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240704221129.357335-1-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox