summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2012-12-17 10:10:13 +0000
committerpjd <pjd@FreeBSD.org>2012-12-17 10:10:13 +0000
commitc4178b76f629a0bf2e7e7afcde1f259b124dce94 (patch)
treea6f4dd974012a39986430426e1cbea42f0b3f87e /sys/netpfil
parent85e6a5356933034ffa9dafaca845a06cccff90f1 (diff)
downloadFreeBSD-src-c4178b76f629a0bf2e7e7afcde1f259b124dce94.zip
FreeBSD-src-c4178b76f629a0bf2e7e7afcde1f259b124dce94.tar.gz
Warn about reaching various PF limits.
Reviewed by: glebius Obtained from: WHEEL Systems
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/pf/pf.c2
-rw-r--r--sys/netpfil/pf/pf_norm.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index d629aea..5d5e797 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -713,6 +713,7 @@ pf_initialize()
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
V_pf_limits[PF_LIMIT_STATES].zone = V_pf_state_z;
uma_zone_set_max(V_pf_state_z, PFSTATE_HIWAT);
+ uma_zone_set_warning(V_pf_state_z, "PF states limit reached");
V_pf_state_key_z = uma_zcreate("pf state keys",
sizeof(struct pf_state_key), pf_state_key_ctor, NULL, NULL, NULL,
@@ -734,6 +735,7 @@ pf_initialize()
0);
V_pf_limits[PF_LIMIT_SRC_NODES].zone = V_pf_sources_z;
uma_zone_set_max(V_pf_sources_z, PFSNODE_HIWAT);
+ uma_zone_set_warning(V_pf_sources_z, "PF source nodes limit reached");
V_pf_srchash = malloc(V_pf_srchashsize * sizeof(struct pf_srchash),
M_PFHASH, M_WAITOK|M_ZERO);
V_pf_srchashmask = V_pf_srchashsize - 1;
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index 9063fe8..8683d6d 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -161,6 +161,7 @@ pf_normalize_init(void)
V_pf_limits[PF_LIMIT_FRAGS].zone = V_pf_frent_z;
V_pf_limits[PF_LIMIT_FRAGS].limit = PFFRAG_FRENT_HIWAT;
uma_zone_set_max(V_pf_frent_z, PFFRAG_FRENT_HIWAT);
+ uma_zone_set_warning(V_pf_frent_z, "PF frag entries limit reached");
mtx_init(&pf_frag_mtx, "pf fragments", NULL, MTX_DEF);
OpenPOWER on IntegriCloud