]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: Remove flags misinterpretations
authorPhil Sutter <phil@nwl.cc>
Fri, 10 Aug 2018 09:42:16 +0000 (11:42 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 10 Aug 2018 09:49:15 +0000 (11:49 +0200)
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>
iptables/xtables-eb.c

index ac3ecb8ed64895f9798eb92765d6287c361a3baf..798c027c134ac4ed5bc502383ed02ba7533aeae5 100644 (file)
@@ -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')