summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index fa522b4e5ca9..35536617b78c 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1131,9 +1131,14 @@ tcp_connect(tp, nam, td)
inp->inp_laddr = laddr;
in_pcbrehash(inp);
- /* Compute window scaling to request. */
+ /*
+ * Compute window scaling to request:
+ * Scale to fit into sweet spot. See tcp_syncache.c.
+ * XXX: This should move to tcp_output().
+ * XXX: This should be based on the actual MSS.
+ */
while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
+ (0x1 << tp->request_r_scale) < tcp_minmss)
tp->request_r_scale++;
soisconnecting(so);