diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2021-12-21 12:40:25 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-12-23 00:22:34 +0100 |
commit | 07af4429241c9832a613cb8620331ac54257d9df (patch) | |
tree | 64ccca3f77fb82787bdad08791070571dbf24415 | |
parent | 3eaba1125798c7b8f2e8ad3d1a572de6b84f4e5a (diff) |
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.
Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/parser_bison.y | 9 |
1 files changed, 8 insertions, 1 deletions
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, |