summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2010-07-01 19:23:51 +0000
committerbeck <beck@openbsd.org>2010-07-01 19:23:51 +0000
commitc856a0e6eddd413954ec23fc1528d9bd4e82a60b (patch)
tree03b21f5f479e54b3b23b5cd69171e299f204dc03
parentremove the try/catch in debug mode, so that we get the errors directly... (diff)
downloadwireguard-openbsd-c856a0e6eddd413954ec23fc1528d9bd4e82a60b.tar.xz
wireguard-openbsd-c856a0e6eddd413954ec23fc1528d9bd4e82a60b.zip
pool setconstraints must be called immediately after pool_init, otherwise
if we allocate memory before applying constraints we get memory outside the constraints allocated in the pool. this is bad. ok claudio@
-rw-r--r--sys/kern/uipc_mbuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 99c1decbb06..dcf977c50a4 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.138 2010/06/27 03:03:48 thib Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.139 2010/07/01 19:23:51 beck Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -137,16 +137,16 @@ mbinit(void)
int i;
pool_init(&mbpool, MSIZE, 0, 0, 0, "mbpl", NULL);
- pool_setlowat(&mbpool, mblowat);
pool_set_constraints(&mbpool, &dma_constraint, 1);
+ pool_setlowat(&mbpool, mblowat);
for (i = 0; i < nitems(mclsizes); i++) {
snprintf(mclnames[i], sizeof(mclnames[0]), "mcl%dk",
mclsizes[i] >> 10);
pool_init(&mclpools[i], mclsizes[i], 0, 0, 0,
mclnames[i], NULL);
- pool_setlowat(&mclpools[i], mcllowat);
pool_set_constraints(&mclpools[i], &dma_constraint, 1);
+ pool_setlowat(&mclpools[i], mcllowat);
}
nmbclust_update();