Page MenuHomeFreeBSD

D60105.diff
No OneTemporary

D60105.diff

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

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)

Event Timeline