diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-04-25 16:25:06 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-04-25 16:25:06 +0000 |
commit | d85fc3f762a827eba7b2a0678830aeaccef883bd (patch) | |
tree | 548f52b3d3f5fdbbd40bc07dfb11ed96ed788433 /sys/kern | |
parent | 5f871d1c97e82c8f4379756c89107e74357708b1 (diff) |
change sb_mbmax to: (sb_max/MCLBYTES) * (MSIZE+MCLBYTES); ok deraadt
CV ----------------------------------------------------------------------
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_socket2.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index eb831138219..cc924dd2c02 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.37 2004/04/19 22:38:39 deraadt Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.38 2004/04/25 16:25:05 markus Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -400,11 +400,10 @@ sbreserve(sb, cc) u_long cc; { - if (cc == 0 || - (u_int64_t)cc > (u_int64_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES)) + if (cc == 0 || cc > sb_max) return (0); sb->sb_hiwat = cc; - sb->sb_mbmax = min(cc * 2, sb_max); + sb->sb_mbmax = min(cc * 2, sb_max + (sb_max / MCLBYTES) * MSIZE); if (sb->sb_lowat > sb->sb_hiwat) sb->sb_lowat = sb->sb_hiwat; return (1); |