summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iptables/nft-ipv4.c9
-rw-r--r--iptables/nft-ipv6.c9
-rw-r--r--iptables/nft-shared.c8
-rw-r--r--iptables/nft-shared.h2
4 files changed, 8 insertions, 20 deletions
diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c
index 2ca3155e..f118dcb8 100644
--- a/iptables/nft-ipv4.c
+++ b/iptables/nft-ipv4.c
@@ -414,13 +414,6 @@ static void nft_ipv4_post_parse(int command,
" source or destination IP addresses");
}
-static void nft_ipv4_save_counters(const void *data)
-{
- const struct iptables_command_state *cs = data;
-
- save_counters(cs->counters.pcnt, cs->counters.bcnt);
-}
-
static int nft_ipv4_xlate(const void *data, struct xt_xlate *xl)
{
const struct iptables_command_state *cs = data;
@@ -492,7 +485,7 @@ struct nft_family_ops nft_family_ops_ipv4 = {
.print_header = print_header,
.print_firewall = nft_ipv4_print_firewall,
.save_firewall = nft_ipv4_save_firewall,
- .save_counters = nft_ipv4_save_counters,
+ .save_counters = save_counters,
.proto_parse = nft_ipv4_proto_parse,
.post_parse = nft_ipv4_post_parse,
.parse_target = nft_ipv46_parse_target,
diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c
index 29b50878..9e9049f3 100644
--- a/iptables/nft-ipv6.c
+++ b/iptables/nft-ipv6.c
@@ -367,13 +367,6 @@ static void nft_ipv6_post_parse(int command, struct iptables_command_state *cs,
" source or destination IP addresses");
}
-static void nft_ipv6_save_counters(const void *data)
-{
- const struct iptables_command_state *cs = data;
-
- save_counters(cs->counters.pcnt, cs->counters.bcnt);
-}
-
static void xlate_ipv6_addr(const char *selector, const struct in6_addr *addr,
const struct in6_addr *mask,
int invert, struct xt_xlate *xl)
@@ -447,7 +440,7 @@ struct nft_family_ops nft_family_ops_ipv6 = {
.print_header = print_header,
.print_firewall = nft_ipv6_print_firewall,
.save_firewall = nft_ipv6_save_firewall,
- .save_counters = nft_ipv6_save_counters,
+ .save_counters = save_counters,
.proto_parse = nft_ipv6_proto_parse,
.post_parse = nft_ipv6_post_parse,
.parse_target = nft_ipv46_parse_target,
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,
diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h
index e4c021e1..578726d0 100644
--- a/iptables/nft-shared.h
+++ b/iptables/nft-shared.h
@@ -165,7 +165,7 @@ void save_firewall_details(const struct iptables_command_state *cs,
unsigned const char *iniface_mask,
const char *outiface,
unsigned const char *outiface_mask);
-void save_counters(uint64_t pcnt, uint64_t bcnt);
+void save_counters(const void *data);
void save_matches_and_target(struct xtables_rule_match *m,
struct xtables_target *target,
const char *jumpto,