netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iptables-translate: Moving of printing nft back to xtables_xlate_main
@ 2016-03-31 18:36 Guruswamy Basavaiah
  2016-04-07  9:51 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Guruswamy Basavaiah @ 2016-03-31 18:36 UTC (permalink / raw)
  To: netfilter-devel

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(-)

diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c
index 354357c..44162a2 100644
--- a/iptables/xtables-translate.c
+++ b/iptables/xtables-translate.c
@@ -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");
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iptables-translate: Moving of printing nft back to xtables_xlate_main
  2016-03-31 18:36 [PATCH] iptables-translate: Moving of printing nft back to xtables_xlate_main Guruswamy Basavaiah
@ 2016-04-07  9:51 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-04-07  9:51 UTC (permalink / raw)
  To: Guruswamy Basavaiah; +Cc: netfilter-devel

On Fri, Apr 01, 2016 at 12:06:24AM +0530, Guruswamy Basavaiah wrote:
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-07  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-31 18:36 [PATCH] iptables-translate: Moving of printing nft back to xtables_xlate_main Guruswamy Basavaiah
2016-04-07  9:51 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).