summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.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/raw_ip.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/raw_ip.c')
-rw-r--r--sys/netinet/raw_ip.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 7d6e5b3..7a7890a 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -116,6 +116,13 @@ void (*ip_rsvp_force_done)(struct socket *);
/*
* Initialize raw connection block q.
*/
+static void
+rip_zone_change(void *tag)
+{
+
+ uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets);
+}
+
void
rip_init()
{
@@ -132,6 +139,8 @@ rip_init()
ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets);
+ EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change,
+ NULL, EVENTHANDLER_PRI_ANY);
}
static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
OpenPOWER on IntegriCloud