diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-01-31 02:34:49 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-01-31 02:36:51 +0100 |
commit | 6a0448eecdee4c6a19303b75c1707915a80cbfbb (patch) | |
tree | 8549b39249ff4bf3a2383318548de799c21efe7a | |
parent | df288236cd254798be3759fef4cbc3e535f5a1c3 (diff) |
iptables: warn when parameter limit is exceeded
While testing many match extensions in a single rule, I ran into this
error not warned about. Arguments were just ignored, causing
surprising "Need to specify an argument to --whatever" when the
argument was in fact given on the command line.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r-- | ip6tables-restore.c | 5 | ||||
-rw-r--r-- | iptables-restore.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ip6tables-restore.c b/ip6tables-restore.c index cea5f36e..9948cd63 100644 --- a/ip6tables-restore.c +++ b/ip6tables-restore.c @@ -103,8 +103,11 @@ static int add_argv(char *what) { newargv[newargc] = strdup(what); newargc++; return 1; - } else + } else { + xtables_error(PARAMETER_PROBLEM, + "Parser cannot handle more arguments\n"); return 0; + } } static void free_argv(void) { diff --git a/iptables-restore.c b/iptables-restore.c index bf80e788..519d4800 100644 --- a/iptables-restore.c +++ b/iptables-restore.c @@ -103,8 +103,11 @@ static int add_argv(char *what) { newargv[newargc] = strdup(what); newargc++; return 1; - } else + } else { + xtables_error(PARAMETER_PROBLEM, + "Parser cannot handle more arguments\n"); return 0; + } } static void free_argv(void) { |