summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ip6tables.c19
-rw-r--r--iptables.c19
2 files changed, 36 insertions, 2 deletions
diff --git a/ip6tables.c b/ip6tables.c
index 293ba37f..3c45c072 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -1888,9 +1888,26 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
continue;
}
- if (!m)
+ if (!m) {
+ if (c == '?') {
+ if (optopt) {
+ exit_error(
+ PARAMETER_PROBLEM,
+ "option `%s' "
+ "requires an "
+ "argument",
+ argv[optind-1]);
+ } else {
+ exit_error(
+ PARAMETER_PROBLEM,
+ "unknown option "
+ "`%s'",
+ argv[optind-1]);
+ }
+ }
exit_error(PARAMETER_PROBLEM,
"Unknown arg `%s'", optarg);
+ }
}
}
invert = FALSE;
diff --git a/iptables.c b/iptables.c
index 2c6b4dcc..b75df871 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1909,9 +1909,26 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
optind--;
continue;
}
- if (!m)
+ if (!m) {
+ if (c == '?') {
+ if (optopt) {
+ exit_error(
+ PARAMETER_PROBLEM,
+ "option `%s' "
+ "requires an "
+ "argument",
+ argv[optind-1]);
+ } else {
+ exit_error(
+ PARAMETER_PROBLEM,
+ "unknown option "
+ "`%s'",
+ argv[optind-1]);
+ }
+ }
exit_error(PARAMETER_PROBLEM,
"Unknown arg `%s'", optarg);
+ }
}
}
invert = FALSE;