Blame SOURCES/0033-arptables-nft-Fix-listing-rules-without-target.patch

8cce6c
From 6ae39816fe49ad3210a6a4ff1b997775e688be9a Mon Sep 17 00:00:00 2001
8cce6c
From: Phil Sutter <phil@nwl.cc>
8cce6c
Date: Thu, 31 Jan 2019 16:12:50 +0100
8cce6c
Subject: [PATCH] arptables-nft: Fix listing rules without target
8cce6c
8cce6c
Don't try to print cs.jumpto if it is an empty string, otherwise listing
8cce6c
(and verbose output) contains '-j' flag without argument.
8cce6c
8cce6c
Signed-off-by: Phil Sutter <phil@nwl.cc>
8cce6c
Signed-off-by: Florian Westphal <fw@strlen.de>
8cce6c
(cherry picked from commit 043bf38bc9ee020bbf1a9789773050d47f83b807)
8cce6c
Signed-off-by: Phil Sutter <psutter@redhat.com>
8cce6c
---
8cce6c
 iptables/nft-arp.c | 2 +-
8cce6c
 1 file changed, 1 insertion(+), 1 deletion(-)
8cce6c
8cce6c
diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c
8cce6c
index 37850bd328b71..56021223bdbe6 100644
8cce6c
--- a/iptables/nft-arp.c
8cce6c
+++ b/iptables/nft-arp.c
8cce6c
@@ -598,7 +598,7 @@ nft_arp_print_rule(struct nftnl_rule *r, unsigned int num, unsigned int format)
8cce6c
 
8cce6c
 	nft_rule_to_iptables_command_state(r, &cs);
8cce6c
 
8cce6c
-	if (cs.jumpto)
8cce6c
+	if (strlen(cs.jumpto))
8cce6c
 		printf("-j %s ", cs.jumpto);
8cce6c
 	nft_arp_print_rule_details(&cs.arp, format);
8cce6c
 	print_matches_and_target(&cs, format);
8cce6c
-- 
8cce6c
2.20.1
8cce6c