Skip to contentSkip to conversation

Not printing "nft" in iptables-restore-translate command

PATCH Applied Guruswamy Basavaiah 2 participants 2 messages Apr 11, 2016 – Apr 12, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Not printing "nft" in iptables-restore-translate command

No need to print "nft" in function do_command_xlate,
if the function is called from iptables-restore-translate command.

---
 iptables/xtables-translate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
iptables/xtables-translate.c +3 -1
index 0b2c0bf..1c64178 100644
@@ -193,7 +193,9 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
 
 	do_parse(h, argc, argv, &p, &cs, &args);
 
-	printf("nft ");
+	if (!restore) {
+		printf("nft ");
+	}
 	switch (p.command) {
 	case CMD_APPEND:
 		ret = 1;
Signature · 1 line
2.5.5
maintainer Applied
#1 lore raw
Quoted 2 lines · Guruswamy Basavaiah

No need to print "nft" in function do_command_xlate,
if the function is called from iptables-restore-translate command.

Applied, thanks.