]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
arptables-nft: Fix listing rules without target
authorPhil Sutter <phil@nwl.cc>
Thu, 31 Jan 2019 15:12:50 +0000 (16:12 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 31 Jan 2019 21:53:00 +0000 (22:53 +0100)
Don't try to print cs.jumpto if it is an empty string, otherwise listing
(and verbose output) contains '-j' flag without argument.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/nft-arp.c

index 399f83afff5cc36ce98f14d8b41a07fa9ab50b88..5567daa7ad5301026c6ea53448f6c104b5f4078b 100644 (file)
@@ -598,7 +598,7 @@ nft_arp_print_rule(struct nftnl_rule *r, unsigned int num, unsigned int format)
 
        nft_rule_to_iptables_command_state(r, &cs);
 
-       if (cs.jumpto)
+       if (strlen(cs.jumpto))
                printf("-j %s ", cs.jumpto);
        nft_arp_print_rule_details(&cs.arp, format);
        print_matches_and_target(&cs, format);