1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-08 08:27:00 +00:00

Use IPFW_RULE_CNTR_SIZE macro instead of non-relevant ip_fw_cntr structure.

Found by:	luigi
This commit is contained in:
Alexander V. Chernikov 2014-10-18 17:23:41 +00:00
parent 4cc7d0982c
commit 0d90989bef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273260
2 changed files with 3 additions and 7 deletions

View File

@ -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 {

View File

@ -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);
}