]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: Fix for single line ct timeout printing
authorPhil Sutter <phil@nwl.cc>
Wed, 16 Oct 2019 22:20:59 +0000 (00:20 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 17 Oct 2019 10:49:10 +0000 (12:49 +0200)
Commit 43ae7a48ae3de ("rule: do not print semicolon in ct timeout")
removed an extra semicolon at end of line, but thereby broke single line
output. The correct fix is to use opts->stmt_separator which holds
either newline or semicolon chars depending on output mode.

Fixes: 43ae7a48ae3de ("rule: do not print semicolon in ct timeout")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Florian Westphal <fw@strlen.de>
src/rule.c

index 2d35bae44c9e57575ec00b974dfcb94c51858783..3c7c8d63f8cdf4f1d2a755aa705e7206a4896ec7 100644 (file)
@@ -1869,7 +1869,7 @@ static void obj_print_data(const struct obj *obj,
                nft_print(octx, "%s", opts->nl);
                nft_print(octx, "%s%sprotocol ", opts->tab, opts->tab);
                print_proto_name_proto(obj->ct_timeout.l4proto, octx);
-               nft_print(octx, "%s", opts->nl);
+               nft_print(octx, "%s", opts->stmt_separator);
                nft_print(octx, "%s%sl3proto %s%s",
                          opts->tab, opts->tab,
                          family2str(obj->ct_timeout.l3proto),