summaryrefslogtreecommitdiffstats
path: root/iptables/nft-shared.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-07-19 18:32:03 +0200
committerFlorian Westphal <fw@strlen.de>2018-07-19 23:10:06 +0200
commit444d581bcc561a73d172522a83b91772f9130ba3 (patch)
treea11a0a87cecad3a622c4f714941924719fdeb88c /iptables/nft-shared.c
parent34e1e234a937242ebebbe225438b4567ca0c5bd2 (diff)
xtables: get rid of nft_ipv{4,6}_save_counters()
Just replace them by the shared save_counters() function after adjusting it's signature to meet callback requirements. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/nft-shared.c')
-rw-r--r--iptables/nft-shared.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c
index 45e30867..1018b631 100644
--- a/iptables/nft-shared.c
+++ b/iptables/nft-shared.c
@@ -794,10 +794,12 @@ void save_firewall_details(const struct iptables_command_state *cs,
}
}
-void save_counters(uint64_t pcnt, uint64_t bcnt)
+void save_counters(const void *data)
{
- printf("[%llu:%llu] ", (unsigned long long)pcnt,
- (unsigned long long)bcnt);
+ const struct iptables_command_state *cs = data;
+
+ printf("[%llu:%llu] ", (unsigned long long)cs->counters.pcnt,
+ (unsigned long long)cs->counters.bcnt);
}
void save_matches_and_target(struct xtables_rule_match *m,