aboutsummaryrefslogtreecommitdiff
path: root/sys/netpfil
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2014-10-18 17:23:41 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2014-10-18 17:23:41 +0000
commit0d90989bef809a846289f8414875c0abe49e7fb6 (patch)
tree3aa102bf0fa284ab9a95e3e866c20fc174da1beb /sys/netpfil
parent4cc7d0982c845929f35ab6a74c042d3b0a8b69cb (diff)
downloadsrc-0d90989bef809a846289f8414875c0abe49e7fb6.tar.gz
src-0d90989bef809a846289f8414875c0abe49e7fb6.zip
Use IPFW_RULE_CNTR_SIZE macro instead of non-relevant ip_fw_cntr structure.
Found by: luigi
Notes
Notes: svn path=/head/; revision=273260
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/ipfw/ip_fw_private.h8
-rw-r--r--sys/netpfil/ipfw/ip_fw_sockopt.c2
2 files changed, 3 insertions, 7 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_private.h b/sys/netpfil/ipfw/ip_fw_private.h
index bd13ae651580..5da2c0cac7ea 100644
--- a/sys/netpfil/ipfw/ip_fw_private.h
+++ b/sys/netpfil/ipfw/ip_fw_private.h
@@ -226,12 +226,6 @@ VNET_DECLARE(unsigned int, fw_tables_sets);
struct tables_config;
#ifdef _KERNEL
-typedef struct ip_fw_cntr {
- uint64_t pcnt; /* Packet counter */
- uint64_t bcnt; /* Byte counter */
- uint64_t timestamp; /* tv_sec of last match */
-} ip_fw_cntr;
-
/*
* Here we have the structure representing an ipfw rule.
*
@@ -261,6 +255,8 @@ struct ip_fw {
ipfw_insn cmd[1]; /* storage for commands */
};
+#define IPFW_RULE_CNTR_SIZE (2 * sizeof(counter_u64_t))
+
#endif
struct ip_fw_chain {
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index 0c0d022dd8b1..8293c34c2169 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -162,7 +162,7 @@ ipfw_init_counters()
{
V_ipfw_cntr_zone = uma_zcreate("IPFW counters",
- sizeof(ip_fw_cntr), NULL, NULL, NULL, NULL,
+ IPFW_RULE_CNTR_SIZE, NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, UMA_ZONE_PCPU);
}