summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.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/udp_usrreq.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/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index e00892d..fb0b76a 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -38,6 +38,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/domain.h>
+#include <sys/eventhandler.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/lock.h>
@@ -129,6 +130,13 @@ static void udp_detach(struct socket *so);
static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *,
struct mbuf *, struct thread *);
+static void
+udp_zone_change(void *tag)
+{
+
+ uma_zone_set_max(udbinfo.ipi_zone, maxsockets);
+}
+
void
udp_init()
{
@@ -141,6 +149,8 @@ udp_init()
udbinfo.ipi_zone = uma_zcreate("udpcb", sizeof(struct inpcb), NULL,
NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
uma_zone_set_max(udbinfo.ipi_zone, maxsockets);
+ EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL,
+ EVENTHANDLER_PRI_ANY);
}
void
OpenPOWER on IntegriCloud