diff options
author | Giuseppe Longo <giuseppelng@gmail.com> | 2014-06-11 10:53:12 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-06-11 10:58:00 +0200 |
commit | 1aefddd07ca8e51f0528366835cf466d57bd459f (patch) | |
tree | 37f0c0fd3af991eaf19e2a8987edb7f6c4862ff9 /iptables/nft-arp.c | |
parent | f1299b98d7ff200eb50ca574278bfeb1368de01b (diff) |
nft: save: fix the printing of the counters
This patch prints the counters of a rule before the details,
like iptables-save syntax.
Signed-off-by: Giuseppe Longo <giuseppelng@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft-arp.c')
-rw-r--r-- | iptables/nft-arp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c index 562a1a29..8c062435 100644 --- a/iptables/nft-arp.c +++ b/iptables/nft-arp.c @@ -599,12 +599,6 @@ static void nft_arp_save_firewall(const void *data, print_fw_details((struct arpt_entry *)fw, format); - if (!(format & FMT_NOCOUNTS)) { - printf("-c "); - xtables_print_num(fw->counters.pcnt, format); - xtables_print_num(fw->counters.bcnt, format); - } - target = get_target((struct arpt_entry *)fw, format); if (target) { @@ -680,6 +674,13 @@ static bool nft_arp_rule_find(struct nft_family_ops *ops, struct nft_rule *r, return true; } +static void nft_arp_save_counters(const void *data) +{ + const struct arpt_entry *fw = data; + + save_counters(fw->counters.pcnt, fw->counters.bcnt); +} + struct nft_family_ops nft_family_ops_arp = { .add = nft_arp_add, .is_same = nft_arp_is_same, @@ -689,6 +690,7 @@ struct nft_family_ops nft_family_ops_arp = { .parse_immediate = nft_arp_parse_immediate, .print_firewall = nft_arp_print_firewall, .save_firewall = nft_arp_save_firewall, + .save_counters = nft_arp_save_counters, .post_parse = NULL, .rule_find = nft_arp_rule_find, .parse_target = nft_arp_parse_target, |