diff options
author | Phil Sutter <phil@nwl.cc> | 2020-11-11 17:16:40 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2021-05-17 15:06:48 +0200 |
commit | 3664249f520308e8d9ce6238374f08ac96aedbb6 (patch) | |
tree | e71eed5f4bbf2e73c00b9045a45c22c6499c34f2 /iptables/xshared.c | |
parent | f647f61f273a15ed25307d7ca7a19cefc828c54c (diff) |
xshared: Eliminate iptables_command_state->invert
This field is not used by routines working with struct
iptables_command_state: It is merely a temporary flag used by parsers to
carry the '!' prefix until invflags have been populated (or error
checking done if unsupported).
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xshared.c')
-rw-r--r-- | iptables/xshared.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/iptables/xshared.c b/iptables/xshared.c index 9a1f465a..afd7a9d6 100644 --- a/iptables/xshared.c +++ b/iptables/xshared.c @@ -115,7 +115,7 @@ struct xtables_match *load_proto(struct iptables_command_state *cs) } int command_default(struct iptables_command_state *cs, - struct xtables_globals *gl) + struct xtables_globals *gl, bool invert) { struct xtables_rule_match *matchp; struct xtables_match *m; @@ -124,7 +124,7 @@ int command_default(struct iptables_command_state *cs, (cs->target->parse != NULL || cs->target->x6_parse != NULL) && cs->c >= cs->target->option_offset && cs->c < cs->target->option_offset + XT_OPTION_OFFSET_SCALE) { - xtables_option_tpcall(cs->c, cs->argv, cs->invert, + xtables_option_tpcall(cs->c, cs->argv, invert, cs->target, &cs->fw); return 0; } @@ -138,7 +138,7 @@ int command_default(struct iptables_command_state *cs, if (cs->c < matchp->match->option_offset || cs->c >= matchp->match->option_offset + XT_OPTION_OFFSET_SCALE) continue; - xtables_option_mpcall(cs->c, cs->argv, cs->invert, m, &cs->fw); + xtables_option_mpcall(cs->c, cs->argv, invert, m, &cs->fw); return 0; } @@ -641,13 +641,13 @@ void print_ifaces(const char *iniface, const char *outiface, uint8_t invflags, printf(FMT("%-6s ", "out %s "), iface); } -void command_match(struct iptables_command_state *cs) +void command_match(struct iptables_command_state *cs, bool invert) { struct option *opts = xt_params->opts; struct xtables_match *m; size_t size; - if (cs->invert) + if (invert) xtables_error(PARAMETER_PROBLEM, "unexpected ! flag before --match"); |