diff options
author | Arturo Borrero <arturo.borrero.glez@gmail.com> | 2014-12-23 13:24:26 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-12-23 14:27:01 +0100 |
commit | 0e65c922fc0d51a8dff1a779863d4ae559aa9a4a (patch) | |
tree | 5a6ec8838c29cb749eb30c9484bbca830fb19102 /iptables/xtables-eb.c | |
parent | 6aa7d1c26d0a3b0c909bbf13aa0ef6b179615433 (diff) |
ebtables-compat: fix counter listing
With this patch:
% sudo ebtables-compat -L --Lc
Bridge table: filter
Bridge chain: INPUT, entries: 0, policy: ACCEPT
-j ACCEPT , pcnt = 123 -- bcnt = 123
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-eb.c')
-rw-r--r-- | iptables/xtables-eb.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index 22ae4fdf..d0f6a3e3 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -486,14 +486,12 @@ static void print_help(const struct xtables_target *t, /* Execute command L */ static int list_rules(struct nft_handle *h, const char *chain, const char *table, int rule_nr, int verbose, int numeric, int expanded, - int linenumbers) + int linenumbers, int counters) { unsigned int format; format = FMT_OPTIONS; - if (!verbose) - format |= FMT_NOCOUNTS; - else + if (verbose) format |= FMT_VIA; if (numeric) @@ -505,6 +503,9 @@ static int list_rules(struct nft_handle *h, const char *chain, const char *table if (linenumbers) format |= FMT_LINENUMBERS; + if (!counters) + format |= FMT_NOCOUNTS; + return nft_rule_list(h, chain, table, rule_nr, format); } @@ -1269,7 +1270,8 @@ check_extension: flags&OPT_VERBOSE, flags&OPT_NUMERIC, /*flags&OPT_EXPANDED*/0, - flags&LIST_N); + flags&LIST_N, + flags&LIST_C); if (!(flags & OPT_ZERO) && exec_style == EXEC_STYLE_PRG) exit(0); } |