From 514de4801b731db471298f4508f9534bcefec006 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 10 Aug 2018 11:42:16 +0200 Subject: 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 Signed-off-by: Florian Westphal --- iptables/xtables-eb.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'iptables/xtables-eb.c') 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') -- cgit v1.2.3