summaryrefslogtreecommitdiffstats
path: root/iptables
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-08-10 11:42:16 +0200
committerFlorian Westphal <fw@strlen.de>2018-08-10 11:49:15 +0200
commit514de4801b731db471298f4508f9534bcefec006 (patch)
tree5c1c035cc803e261929429c6cba61c75a23c8f90 /iptables
parent528cbf99ff6062420270e637df4d40a77514fe56 (diff)
ebtables: Remove flags misinterpretations
This is actually quite a mess: xtables-eb.c defines names for bits in 'flags' variable of do_commandeb(), though these tend to clash with bit names defined in xshared.h due to the same 'OPT_' prefix. Therefore checking for bits OPT_NUMERIC and OPT_VERBOSE is syntactically correct, but semantically wrong as they actually refer to bits OPT_COMMAND and OPT_PROTOCOL. Since ebtables doesn't support numeric nor verbose modes, just replace the checks with zero values. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables')
-rw-r--r--iptables/xtables-eb.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
index ac3ecb8e..798c027c 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -1286,8 +1286,8 @@ check_extension:
xtables_error(PARAMETER_PROBLEM, "Wrong policy");
} else if (command == 'L') {
ret = list_rules(h, chain, *table, rule_nr,
- flags&OPT_VERBOSE,
- flags&OPT_NUMERIC,
+ 0,
+ 0,
/*flags&OPT_EXPANDED*/0,
flags&LIST_N,
flags&LIST_C);
@@ -1296,19 +1296,17 @@ check_extension:
}
if (flags & OPT_ZERO) {
selected_chain = zerochain;
- ret = nft_chain_zero_counters(h, chain, *table,
- flags & OPT_VERBOSE);
+ ret = nft_chain_zero_counters(h, chain, *table, 0);
} else if (command == 'F') {
- ret = nft_rule_flush(h, chain, *table, flags & OPT_VERBOSE);
+ ret = nft_rule_flush(h, chain, *table, 0);
} else if (command == 'A') {
- ret = append_entry(h, chain, *table, &cs, 0,
- flags&OPT_VERBOSE, true);
+ ret = append_entry(h, chain, *table, &cs, 0, 0, true);
} else if (command == 'I') {
ret = append_entry(h, chain, *table, &cs, rule_nr - 1,
- flags&OPT_VERBOSE, false);
+ 0, false);
} else if (command == 'D') {
ret = delete_entry(h, chain, *table, &cs, rule_nr - 1,
- rule_nr_end, flags&OPT_VERBOSE);
+ rule_nr_end, 0);
} /*else if (replace->command == 'C') {
ebt_change_counters(replace, new_entry, rule_nr, rule_nr_end, &(new_entry->cnt_surplus), chcounter);
if (ebt_errormsg[0] != '\0')