summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2006-04-21 09:25:40 +0000
committerps <ps@FreeBSD.org>2006-04-21 09:25:40 +0000
commit10b2fe8deaf19b4c81cb9088e607c6b818b49a2b (patch)
tree104c2b8ecefe4f49f0608012d591ed6bc153383e /sys/netinet/ip_divert.c
parent71dd15704489306788703f67dac59f4814c34efe (diff)
downloadFreeBSD-src-10b2fe8deaf19b4c81cb9088e607c6b818b49a2b.zip
FreeBSD-src-10b2fe8deaf19b4c81cb9088e607c6b818b49a2b.tar.gz
Allow for nmbclusters and maxsockets to be increased via sysctl.
An eventhandler is used to update all the various zones that depend on these values.
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 8cfad6b..2b14f44 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -116,6 +116,13 @@ static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
/*
* Initialize divert connection block queue.
*/
+static void
+div_zone_change(void *tag)
+{
+
+ uma_zone_set_max(divcbinfo.ipi_zone, maxsockets);
+}
+
void
div_init(void)
{
@@ -132,6 +139,8 @@ div_init(void)
divcbinfo.ipi_zone = uma_zcreate("divcb", sizeof(struct inpcb),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
uma_zone_set_max(divcbinfo.ipi_zone, maxsockets);
+ EVENTHANDLER_REGISTER(maxsockets_change, div_zone_change,
+ NULL, EVENTHANDLER_PRI_ANY);
}
/*
OpenPOWER on IntegriCloud