Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153351147
D4129.id10121.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4129.id10121.diff
View Options
Index: sys/kern/uipc_sockbuf.c
===================================================================
--- sys/kern/uipc_sockbuf.c
+++ sys/kern/uipc_sockbuf.c
@@ -397,7 +397,7 @@
sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES);
return (0);
}
-
+
/*
* Allot mbufs to a sockbuf. Attempt to scale mbmax so that mbcnt doesn't
* become limiting if buffering efficiency is near the normal case.
@@ -417,8 +417,12 @@
* appropriate thread resource limits are available. In that case,
* we don't apply a process limit.
*/
- if (cc > sb_max_adj)
+ if (cc > sb_max)
return (0);
+
+ if (cc > sb_max_adj)
+ cc = sb_max_adj;
+
if (td != NULL) {
sbsize_limit = lim_cur(td, RLIMIT_SBSIZE);
} else
@@ -433,7 +437,7 @@
}
int
-sbreserve(struct sockbuf *sb, u_long cc, struct socket *so,
+sbreserve(struct sockbuf *sb, u_long cc, struct socket *so,
struct thread *td)
{
int error;
@@ -1297,7 +1301,7 @@
xsb->sb_cc = sb->sb_ccc;
xsb->sb_hiwat = sb->sb_hiwat;
xsb->sb_mbcnt = sb->sb_mbcnt;
- xsb->sb_mcnt = sb->sb_mcnt;
+ xsb->sb_mcnt = sb->sb_mcnt;
xsb->sb_ccnt = sb->sb_ccnt;
xsb->sb_mbmax = sb->sb_mbmax;
xsb->sb_lowat = sb->sb_lowat;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 3:51 PM (13 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31919062
Default Alt Text
D4129.id10121.diff (1 KB)
Attached To
Mode
D4129: Bug 204438 - setsockopt() handling of kern.ipc.maxsockbuf limit
Attached
Detach File
Event Timeline
Log In to Comment