From 043bf38bc9ee020bbf1a9789773050d47f83b807 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 31 Jan 2019 16:12:50 +0100 Subject: arptables-nft: Fix listing rules without target 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 Signed-off-by: Florian Westphal --- iptables/nft-arp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables/nft-arp.c') diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c index 399f83af..5567daa7 100644 --- a/iptables/nft-arp.c +++ b/iptables/nft-arp.c @@ -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); -- cgit v1.2.3