Linux Netfilter development
 help / color / mirror / Atom feed
* [PATCH nftables] parser: allow quoted string in flowtable_expr_member
@ 2021-12-21 10:40 Stijn Tintel
  2021-12-22 23:32 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Stijn Tintel @ 2021-12-21 10:40 UTC (permalink / raw)
  To: netfilter-devel

Devices with interface names starting with a digit can not be configured
in flowtables. Trying to do so throws the following error:

Error: syntax error, unexpected number, expecting comma or '}'
devices = { eth0, 6in4-wan6 };

This is however a perfectly valid interface name. Solve the issue by
allowing the use of quoted strings.

Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---
 src/parser_bison.y | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 16607bb7..1136ab91 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -2151,7 +2151,14 @@ flowtable_list_expr	:	flowtable_expr_member
 			|	flowtable_list_expr	COMMA	opt_newline
 			;
 
-flowtable_expr_member	:	STRING
+flowtable_expr_member	:	QUOTED_STRING
+			{
+				$$ = constant_expr_alloc(&@$, &string_type,
+							 BYTEORDER_HOST_ENDIAN,
+							 strlen($1) * BITS_PER_BYTE, $1);
+				xfree($1);
+			}
+			|	STRING
 			{
 				$$ = constant_expr_alloc(&@$, &string_type,
 							 BYTEORDER_HOST_ENDIAN,
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-22 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-21 10:40 [PATCH nftables] parser: allow quoted string in flowtable_expr_member Stijn Tintel
2021-12-22 23:32 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox