]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables-restore: resolve confusing policy error message
authorRob Leslie <rob@mars.org>
Tue, 28 Sep 2010 07:43:00 +0000 (00:43 -0700)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 17 Dec 2010 23:11:30 +0000 (00:11 +0100)
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 <jengelh@medozas.de>
ip6tables-restore.c
iptables-restore.c

index 008566c4433d16cbf03125494a84e960d1088737..cea5f36e95bdc718f5c120c94ae56702662d79b2 100644 (file)
@@ -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));
                        }
 
index 8c6648e98f46281a67e28f077038f1d25931f70b..bf80e788913944e42a7c51a14257c45fa975e070 100644 (file)
@@ -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));
                        }