summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-translate.c
diff options
context:
space:
mode:
authorGuruswamy Basavaiah <guru2018@gmail.com>2016-02-25 11:04:50 -0800
committerPablo Neira Ayuso <pablo@netfilter.org>2016-03-01 18:49:14 +0100
commit4f75601d37349c5a983a969d46c1ff0604991b5c (patch)
tree4aa7e01fff7aea75e82295bf53558a7ade8fcb1e /iptables/xtables-translate.c
parent1899fe1762df1cfcc7a0c5088f4947947cd6ea69 (diff)
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 <guru2018@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-translate.c')
-rw-r--r--iptables/xtables-translate.c2
1 files changed, 1 insertions, 1 deletions
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");