From 444d581bcc561a73d172522a83b91772f9130ba3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 19 Jul 2018 18:32:03 +0200 Subject: 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 Signed-off-by: Florian Westphal --- iptables/nft-shared.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'iptables/nft-shared.c') 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, -- cgit v1.2.3