iptables-translate: print nft iff there are more expanded rules to print
Pablo Neira Ayuso
maintainerPATCH 1/1 iptables-translate: print nft iff there are more expanded rules to print
$ iptables-translate -I INPUT -s yahoo.com nft insert rule ip filter INPUT ip saddr 98.139.183.24 counter nft insert rule ip filter INPUT ip saddr 206.190.36.45 counter nft insert rule ip filter INPUT ip saddr 98.138.253.109 counter nft
This extra 'nft' print is incorrect, just print it if there are more rules to be printed.
Reported-by Alexander Alemayhu <[email protected]>
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- iptables/xtables-translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/xtables-translate.c +1 -1
@@ -195,7 +195,7 @@ static int xlate(struct nft_handle *h, struct nft_xt_cmd_parse *p, }break ; } -if (!cs->restore) +if (!cs->restore && i < args->s.naddrs -1 )printf ("nft " ); }
Signature · 1 line
2.1.4
Quoted 11 lines · Pablo Neira Ayuso
$ iptables-translate -I INPUT -s yahoo.com nft insert rule ip filter INPUT ip saddr 98.139.183.24 counter nft insert rule ip filter INPUT ip saddr 206.190.36.45 counter nft insert rule ip filter INPUT ip saddr 98.138.253.109 counter nftThis extra 'nft' print is incorrect, just print it if there are more rules to be printed.
Reported-by Alexander Alemayhu <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>
Tested-by Alexander Alemayhu <[email protected]>
Signature · 3 lines
Mit freundlichen Grüßen Alexander Alemayhu