From: Rob Leslie Date: Tue, 28 Sep 2010 07:43:00 +0000 (-0700) Subject: iptables-restore: resolve confusing policy error message X-Git-Tag: v1.4.11~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6d6449c88812634e663cef4e09db7b691af3eb5;p=thirdparty%2Fiptables.git iptables-restore: resolve confusing policy error message When iptables-restore (and ip6tables-restore) is unable to set a chain's policy, it responds with a confusing message, e.g.: iptables-restore v1.4.9: Can't set policy "PREROUTING" on "ACCEPT" line 16: Bad built-in chain name This is due to the chain and policy arguments being used in the wrong order. The attached patch corrects this problem. Signed-off-by: Jan Engelhardt --- diff --git a/ip6tables-restore.c b/ip6tables-restore.c index 008566c4..cea5f36e 100644 --- a/ip6tables-restore.c +++ b/ip6tables-restore.c @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) xtables_error(OTHER_PROBLEM, "Can't set policy `%s'" " on `%s' line %u: %s\n", - chain, policy, line, + policy, chain, line, ip6tc_strerror(errno)); } diff --git a/iptables-restore.c b/iptables-restore.c index 8c6648e9..bf80e788 100644 --- a/iptables-restore.c +++ b/iptables-restore.c @@ -317,7 +317,7 @@ main(int argc, char *argv[]) xtables_error(OTHER_PROBLEM, "Can't set policy `%s'" " on `%s' line %u: %s\n", - chain, policy, line, + policy, chain, line, iptc_strerror(errno)); }