diff options
author | wollman <wollman@FreeBSD.org> | 1998-03-24 18:06:34 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1998-03-24 18:06:34 +0000 |
commit | d43e6115b673fe03cf9272a6c74af0c41177fef9 (patch) | |
tree | 566a95c1f14bd40b7c20c3cb610da126805e9eed /sys/netinet/raw_ip.c | |
parent | 297cf38a76000d829e4962efc26732a7e4eef52d (diff) | |
download | FreeBSD-src-d43e6115b673fe03cf9272a6c74af0c41177fef9.zip FreeBSD-src-d43e6115b673fe03cf9272a6c74af0c41177fef9.tar.gz |
Use the zone allocator to allocate inpcbs and tcpcbs. Each protocol creates
its own zone; this is used particularly by TCP which allocates both inpcb and
tcpcb in a single allocation. (Some hackery ensures that the tcpcb is
reasonably aligned.) Also keep track of the number of pcbs of each type
allocated, and keep a generation count (instance version number) for future
use.
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 95f364e..a8103ff 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $Id: raw_ip.c,v 1.50 1997/12/18 09:13:39 davidg Exp $ + * $Id: raw_ip.c,v 1.51 1998/01/27 09:15:07 davidg Exp $ */ #include <sys/param.h> @@ -44,6 +44,7 @@ #include <sys/socket.h> #include <sys/socketvar.h> #include <sys/sysctl.h> +#include <vm/vm_zone.h> #include <net/if.h> #include <net/route.h> @@ -94,6 +95,8 @@ rip_init() */ ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask); ripcbinfo.porthashbase = hashinit(1, M_PCB, &ripcbinfo.porthashmask); + ripcbinfo.ipi_zone = zinit("ripcb", sizeof(struct inpcb), + nmbclusters/4, ZONE_INTERRUPT, 0); } static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET }; |