laurenceman / rpms / iptables

Forked from rpms/iptables 5 years ago
Clone

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

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