Skip to contentSkip to conversation

parser: allow quoted string in flowtable_expr_member

PATCH Applied Stijn Tintel 2 participants 2 messages Dec 21, 2021 – Dec 22, 2021 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parser: allow quoted string in flowtable_expr_member

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.

---
 src/parser_bison.y | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
src/parser_bison.y +8 -1
index 16607bb7..1136ab91 100644
@@ -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,
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Stijn Tintel

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.

Applied, thanks