Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173913544
D60105.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
D60105.diff
View Options
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -3886,18 +3886,15 @@
mss = tp->t_maxseg;
/*
- * If there's a pipesize, change the socket buffer to that size,
- * don't change if sb_hiwat is different than default (then it
- * has been changed on purpose with setsockopt).
+ * If there's a pipesize, change the socket buffer to that size, unless
+ * it has been set by a setsockopt(2).
* Make the socket buffers an integral number of mss units;
* if the mss is larger than the socket buffer, decrease the mss.
*/
so = inp->inp_socket;
SOCK_SENDBUF_LOCK(so);
- if ((so->so_snd.sb_hiwat == V_tcp_sendspace) && metrics.hc_sendpipe)
- bufsize = metrics.hc_sendpipe;
- else
- bufsize = so->so_snd.sb_hiwat;
+ bufsize = (so->so_snd.sb_flags & SB_AUTOSIZE) ?
+ max(metrics.hc_sendpipe, so->so_snd.sb_hiwat) : so->so_snd.sb_hiwat;
if (bufsize < mss)
mss = bufsize;
else {
@@ -3929,10 +3926,8 @@
}
SOCK_RECVBUF_LOCK(so);
- if ((so->so_rcv.sb_hiwat == V_tcp_recvspace) && metrics.hc_recvpipe)
- bufsize = metrics.hc_recvpipe;
- else
- bufsize = so->so_rcv.sb_hiwat;
+ bufsize = (so->so_rcv.sb_flags & SB_AUTOSIZE) ?
+ max(metrics.hc_recvpipe, so->so_rcv.sb_hiwat) : so->so_rcv.sb_hiwat;
if (bufsize > mss) {
bufsize = roundup(bufsize, mss);
if (bufsize > sb_max)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 30, 7:50 AM (1 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39892831
Default Alt Text
D60105.diff (1 KB)
Attached To
Mode
D60105: tcp: use SB_AUTOSIZE flag to tell if socket buffer was set
Attached
Detach File
Event Timeline
Log In to Comment