summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-03-09 14:31:31 +0100
committerPhil Sutter <phil@nwl.cc>2023-03-10 12:25:08 +0100
commitaef5330fe7827f760b70d5d27010445c3adb3d3c (patch)
tree33997b53f20c7eab86af9f523ed60a46fe57d4d1 /src/parser_bison.y
parent5d795c183c02332d3b30e08e23f3fb47ad8be6bb (diff)
xt: Fix fallback printing for extensions matching keywords
Yet another Bison workaround: Instead of the fancy error message, an incomprehensible syntax error is emitted: | # iptables-nft -A FORWARD -p tcp -m osf --genre linux | # nft list ruleset | nft -f - | # Warning: table ip filter is managed by iptables-nft, do not touch! | /dev/stdin:4:29-31: Error: syntax error, unexpected osf, expecting string | meta l4proto tcp xt match osf counter packets 0 bytes 0 | ^^^ Avoid this by quoting the extension name when printing: | # nft list ruleset | sudo ./src/nft -f - | # Warning: table ip filter is managed by iptables-nft, do not touch! | /dev/stdin:4:20-33: Error: unsupported xtables compat expression, use iptables-nft with this ruleset | meta l4proto tcp xt match "osf" counter packets 0 bytes 0 | ^^^^^^^^^^^^^^ Fixes: 79195a8cc9e9d ("xt: Rewrite unsupported compat expression dumping") Fixes: e41c53ca5b043 ("xt: Fall back to generic printing from translation") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index b1b67623..3c06ff48 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -2998,7 +2998,7 @@ stmt : verdict_stmt
| xt_stmt close_scope_xt
;
-xt_stmt : XT STRING STRING
+xt_stmt : XT STRING string
{
$$ = NULL;
xfree($2);