[PATCH 01/13] iptables-restore: resolve confusing policy error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rob Leslie <rob@xxxxxxxx>

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@xxxxxxxxxx>
---
 ip6tables-restore.c |    2 +-
 iptables-restore.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index 008566c..cea5f36 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 8c6648e..bf80e78 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));
 			}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux