summaryrefslogtreecommitdiffstats
path: root/ip6tables.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-10-29 18:57:42 +0200
committerPatrick McHardy <kaber@trash.net>2010-10-29 18:57:42 +0200
commit600f38db82548a683775fd89b6e136673e924097 (patch)
treec97526e59daddebe70288aeabb67e702e141e569 /ip6tables.c
parent81defdb2c3ad0e461f6487dc75abb8d4fc77519b (diff)
libxtables: change option precedence order to be intuitive
When using `-m mark --mark 2 -m connmark --mark 2`, the user currently gets an error about the (libxt_mark) --mark option being used twice. This is because libxt_connmark's option table does not override any previous options. This patch changes this behavior, since the current behavior does not allow connmark's option to be used at all, which is illogical. Cc: Florian Westphal <fw@strlen.de> Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'ip6tables.c')
-rw-r--r--ip6tables.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ip6tables.c b/ip6tables.c
index 15067da2..150893d4 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -147,7 +147,6 @@ void ip6tables_exit_error(enum xtables_exittype status, const char *msg, ...) __
struct xtables_globals ip6tables_globals = {
.option_offset = 0,
.program_version = IPTABLES_VERSION,
- .opts = original_opts,
.orig_opts = original_opts,
.exit_err = ip6tables_exit_error,
};
@@ -1561,7 +1560,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
target->t->u.user.revision = target->revision;
if (target->init != NULL)
target->init(target->t);
- opts = xtables_merge_options(opts,
+ opts = xtables_merge_options(ip6tables_globals.orig_opts, opts,
target->extra_opts,
&target->option_offset);
if (opts == NULL)
@@ -1615,7 +1614,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
m->init(m->m);
if (m != m->next)
/* Merge options for non-cloned matches */
- opts = xtables_merge_options(opts, m->extra_opts, &m->option_offset);
+ opts = xtables_merge_options(ip6tables_globals.orig_opts, opts, m->extra_opts, &m->option_offset);
}
break;
@@ -1762,7 +1761,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
if (m->init != NULL)
m->init(m->m);
- opts = xtables_merge_options(opts,
+ opts = xtables_merge_options(ip6tables_globals.orig_opts, opts,
m->extra_opts, &m->option_offset);
optind--;