summaryrefslogtreecommitdiffstats
path: root/iptables/ip6tables-restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables/ip6tables-restore.c')
-rw-r--r--iptables/ip6tables-restore.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c
index 1e50bf0d..eaa2bcbc 100644
--- a/iptables/ip6tables-restore.c
+++ b/iptables/ip6tables-restore.c
@@ -165,8 +165,11 @@ static void add_param_to_argv(char *parsestart)
param_buffer[param_len] = '\0';
/* check if table name specified */
- if (!strncmp(param_buffer, "-t", 2)
- || !strncmp(param_buffer, "--table", 8)) {
+ if ((param_buffer[0] == '-' &&
+ param_buffer[1] != '-' &&
+ strchr(param_buffer, 't')) ||
+ (!strncmp(param_buffer, "--t", 3) &&
+ !strncmp(param_buffer, "--table", strlen(param_buffer)))) {
xtables_error(PARAMETER_PROBLEM,
"The -t option (seen in line %u) cannot be "
"used in ip6tables-restore.\n", line);