diff options
author | Patrick McHardy <kaber@trash.net> | 2010-11-15 11:39:55 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-11-15 11:39:55 +0100 |
commit | e84f131b5f992577119bd3679241f69ec394e0a7 (patch) | |
tree | 32d34439bc01c3102d1726d0ff1e483a4e483227 /iptables.c | |
parent | 648fd1ad68ae2ec675ac07efee80783912535404 (diff) |
Revert "libxtables: change option precedence order to be intuitive"
This reverts commit 600f38db82548a683775fd89b6e136673e924097.
The commit breaks option parsing:
iptables v1.4.9: host/network `port' not found
Try `iptables -h' or 'iptables --help' for more information.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'iptables.c')
-rw-r--r-- | iptables.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -147,6 +147,7 @@ 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, }; @@ -1575,9 +1576,7 @@ 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( - iptables_globals.orig_opts, - opts, + opts = xtables_merge_options(opts, target->extra_opts, &target->option_offset); if (opts == NULL) @@ -1637,9 +1636,7 @@ 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( - iptables_globals.orig_opts, - opts, + opts = xtables_merge_options(opts, m->extra_opts, &m->option_offset); if (opts == NULL) @@ -1793,9 +1790,7 @@ 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( - iptables_globals.orig_opts, - opts, + opts = xtables_merge_options(opts, m->extra_opts, &m->option_offset); if (opts == NULL) |