From: Felix Bolte Date: Tue, 21 Jul 2015 15:36:18 +0200 Subject: [PATCH 2/2] ip(6)tables-restore: remove old "-t" check This check became obsolete as the follow up segfault has been fixed. Furthermore the check was insufficient as "-vt" was still triggering an error. We should let iptables decide whether the passed arguments are valid or not. However, multiple "-t" arguments should not harm the outcome as the handle dictates the current table. Signed-off-by: Felix Bolte --- iptables/ip6tables-restore.c | 9 --------- iptables/iptables-restore.c | 9 --------- 2 files changed, 18 deletions(-) diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c index 9393924..cc07b7c 100644 --- a/iptables/ip6tables-restore.c +++ b/iptables/ip6tables-restore.c @@ -154,15 +154,6 @@ 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)) { - xtables_error(PARAMETER_PROBLEM, - "The -t option (seen in line %u) cannot be " - "used in ip6tables-restore.\n", line); - exit(1); - } - add_argv(param_buffer); param_len = 0; } else { diff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c index 638b171..488edb9 100644 --- a/iptables/iptables-restore.c +++ b/iptables/iptables-restore.c @@ -153,15 +153,6 @@ 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)) { - xtables_error(PARAMETER_PROBLEM, - "The -t option (seen in line %u) cannot be " - "used in iptables-restore.\n", line); - exit(1); - } - add_argv(param_buffer); param_len = 0; } else { -- 1.7.9.5