Skip to contentSkip to conversation

iptables-translate: Moving of printing nft back to xtables_xlate_main

PATCH In review Guruswamy Basavaiah 2 participants 2 messages Mar 31, 2016 – Apr 7, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptables-translate: Moving of printing nft back to xtables_xlate_main

Moving of printing "nft" back to xtables_xlate_main from
function do_command_xlate.

This reverts of previous commit 4f75601d37349c5a983a969d46c1ff0604991b5c which was breaking "iptables-restore-translate -f" and "./nft -f"

---
 iptables/xtables-translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/xtables-translate.c +1 -1
index 354357c..44162a2 100644
@@ -193,7 +193,6 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
 
 	do_parse(h, argc, argv, &p, &cs, &args);
 
-	printf("nft ");
 	switch (p.command) {
 	case CMD_APPEND:
 		ret = 1;
@@ -370,6 +369,7 @@ static int xtables_xlate_main(int family, const char *progname, int argc,
 		exit(EXIT_FAILURE);
 	}
 
+	printf("nft ");
 	ret = do_command_xlate(&h, argc, argv, &table, false);
 	if (!ret)
 		fprintf(stderr, "Translation not implemented\n");
Signature · 1 line
2.5.0
#1 lore raw
Quoted 5 lines · Guruswamy Basavaiah

Moving of printing "nft" back to xtables_xlate_main from
function do_command_xlate.

This reverts of previous commit 4f75601d37349c5a983a969d46c1ff0604991b5c which was breaking "iptables-restore-translate -f" and "./nft -f"

Instead of reverting, you can probably check:

        if (!restore)
                printf("nft ");

so the nft keyword is not shown via iptables-restore-translate.