[iptables PATCH 1/7] arptables-nft: Fix listing rules without target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 iptables/nft-arp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c
index 399f83afff5cc..5567daa7ad530 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);
-- 
2.20.1




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux