From 4f75601d37349c5a983a969d46c1ff0604991b5c Mon Sep 17 00:00:00 2001 From: Guruswamy Basavaiah Date: Thu, 25 Feb 2016 11:04:50 -0800 Subject: iptables: extensions: iptables-translate prints extra "nft" after printing any error Output of command "./iptables-translate junk" is Bad argument `junk' Try `iptables-translate -h' or 'iptables-translate --help' for more information. nft Output of command "./iptables-translate -B" is iptables-translate v1.6.0: unknown option "-B" Try `iptables-translate -h' or 'iptables-translate --help' for more information. nft nft should have not been printed in both the cases. Moving the printf call after the do_parse function call Signed-off-by: Guruswamy Basavaiah Signed-off-by: Pablo Neira Ayuso --- iptables/xtables-translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables') diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c index 9e2c6aeb..3c5b5775 100644 --- a/iptables/xtables-translate.c +++ b/iptables/xtables-translate.c @@ -191,6 +191,7 @@ 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; @@ -359,7 +360,6 @@ 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"); -- cgit v1.2.3