summaryrefslogtreecommitdiffstats
path: root/iptables.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables.c')
-rw-r--r--iptables.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/iptables.c b/iptables.c
index 840dd3e5..1127bddc 100644
--- a/iptables.c
+++ b/iptables.c
@@ -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) {
@@ -1576,7 +1576,9 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
target->t->u.user.revision = target->revision;
if (target->init != NULL)
target->init(target->t);
- opts = xtables_merge_options(opts,
+ opts = xtables_merge_options(
+ iptables_globals.orig_opts,
+ opts,
target->extra_opts,
&target->option_offset);
if (opts == NULL)
@@ -1636,7 +1638,9 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
m->init(m->m);
if (m != m->next) {
/* Merge options for non-cloned matches */
- opts = xtables_merge_options(opts,
+ opts = xtables_merge_options(
+ iptables_globals.orig_opts,
+ opts,
m->extra_opts,
&m->option_offset);
if (opts == NULL)
@@ -1790,7 +1794,9 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
if (m->init != NULL)
m->init(m->m);
- opts = xtables_merge_options(opts,
+ opts = xtables_merge_options(
+ iptables_globals.orig_opts,
+ opts,
m->extra_opts,
&m->option_offset);
if (opts == NULL)