aboutsummaryrefslogtreecommitdiff
path: root/sys/netpfil
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-03-30 19:41:44 +0000
committerMark Johnston <markj@FreeBSD.org>2022-03-30 19:41:44 +0000
commit7d1ab866911a2b29e041d64bc83a93638533f957 (patch)
tree82b13cdbb9cf8d0ab8f404569dc123ef2d3bcdcc /sys/netpfil
parent8299f9a5c167618416c21acd8a9fdd188f400172 (diff)
downloadsrc-7d1ab866911a2b29e041d64bc83a93638533f957.tar.gz
src-7d1ab866911a2b29e041d64bc83a93638533f957.zip
pf: Initialize the table entry zone limit at initialization time
The limit may later be updated by the "set limit" directive in pf.conf. UMA does not permit a limit to be set on a zone after any items have been allocated from a zone. Other UMA zones used by pf do not appear to be susceptible to this problem: they either set a limit at zone creation time or never set one at all. PR: 260406 Reviewed by: kp MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34713
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/pf/pf_table.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index 2352e43cb342..a2afd5c24cff 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -210,6 +210,7 @@ pfr_initialize(void)
V_pfr_kentry_z = uma_zcreate("pf table entries",
sizeof(struct pfr_kentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
0);
+ uma_zone_set_max(V_pfr_kentry_z, PFR_KENTRY_HIWAT);
V_pf_limits[PF_LIMIT_TABLE_ENTRIES].zone = V_pfr_kentry_z;
V_pf_limits[PF_LIMIT_TABLE_ENTRIES].limit = PFR_KENTRY_HIWAT;
}