diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-11-28 15:35:06 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-11-28 15:41:03 +0100 |
commit | d3b2e391e3b944581e20e216af76339cc87d0590 (patch) | |
tree | 8401556f1d85d4ec879774959b10abf7246af2cc /iptables.c | |
parent | a905ea5c97149da9d76cd278b0447e3316087a45 (diff) |
iptables: reset options at the start of each command
For each new command, iptables is supposed to start afresh with a
blank option set (opts) that only contains the program-specific
options (orig_opts), without any extension options. We failed to
restore this pointer (in function do_command) after the previous free
call in xtables_free_opts.
Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'iptables.c')
-rw-r--r-- | iptables.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -147,7 +147,6 @@ void iptables_exit_error(enum xtables_exittype status, const char *msg, ...) __a struct xtables_globals iptables_globals = { .option_offset = 0, .program_version = IPTABLES_VERSION, - .opts = original_opts, .orig_opts = original_opts, .exit_err = iptables_exit_error, }; @@ -1358,6 +1357,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle demand-load a protocol. */ opterr = 0; + opts = xt_params->orig_opts; while ((c = getopt_long(argc, argv, "-A:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:fbvnt:m:xc:g:", opts, NULL)) != -1) { |