summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Silbersack <silby@FreeBSD.org>2002-01-09 01:45:17 +0000
committerMike Silbersack <silby@FreeBSD.org>2002-01-09 01:45:17 +0000
commit9f5193ca0bb65e1cab32aaf77f33cbeba6e677ab (patch)
treea43b0f89c9ab2f355377b619b7873378e609ac2e
parent04073a7ec5a239fd62ce5bf1d8e3b560a6bedc2e (diff)
Notes
-rw-r--r--sys/kern/uipc_sockbuf.c4
-rw-r--r--sys/kern/uipc_socket2.c4
2 files changed, 2 insertions, 6 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index 305aaadd8579..dc1f4cb027ee 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -422,9 +422,7 @@ sbreserve(sb, cc, so, td)
* td will only be NULL when we're in an interrupt
* (e.g. in tcp_input())
*/
- if (sb_max < MSIZE + MCLBYTES)
- sb_max = MSIZE + MCLBYTES;
- if ((u_quad_t)cc > (u_quad_t)(MCLBYTES * (sb_max / (MSIZE + MCLBYTES))))
+ if ((u_quad_t)cc > (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES))
return (0);
if (!chgsbsize(so->so_cred->cr_uidinfo, &sb->sb_hiwat, cc,
td ? td->td_proc->p_rlimit[RLIMIT_SBSIZE].rlim_cur : RLIM_INFINITY)) {
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index 305aaadd8579..dc1f4cb027ee 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -422,9 +422,7 @@ sbreserve(sb, cc, so, td)
* td will only be NULL when we're in an interrupt
* (e.g. in tcp_input())
*/
- if (sb_max < MSIZE + MCLBYTES)
- sb_max = MSIZE + MCLBYTES;
- if ((u_quad_t)cc > (u_quad_t)(MCLBYTES * (sb_max / (MSIZE + MCLBYTES))))
+ if ((u_quad_t)cc > (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES))
return (0);
if (!chgsbsize(so->so_cred->cr_uidinfo, &sb->sb_hiwat, cc,
td ? td->td_proc->p_rlimit[RLIMIT_SBSIZE].rlim_cur : RLIM_INFINITY)) {