diff options
author | silby <silby@FreeBSD.org> | 2007-10-19 08:53:14 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2007-10-19 08:53:14 +0000 |
commit | 85eb47c084ff4c6b21233bbc01f52039aa0d3d6d (patch) | |
tree | 2b1f7df485721b6ec0d5c7a4ba3f55f3d01aadbf /sys/netinet/tcp_usrreq.c | |
parent | 58861a78239fd839c1b67fc97e318fd926a195ef (diff) | |
download | FreeBSD-src-85eb47c084ff4c6b21233bbc01f52039aa0d3d6d.zip FreeBSD-src-85eb47c084ff4c6b21233bbc01f52039aa0d3d6d.tar.gz |
Pick the smallest possible TCP window scaling factor that will still allow
us to scale up to sb_max, aka kern.ipc.maxsockbuf.
We do this because there are broken firewalls that will corrupt the window
scale option, leading to the other endpoint believing that our advertised
window is unscaled. At scale factors larger than 5 the unscaled window will
drop below 1500 bytes, leading to serious problems when traversing these
broken firewalls.
With the default maxsockbuf of 256K, a scale factor of 3 will be chosen by
this algorithm. Those who choose a larger maxsockbuf should watch out
for the compatiblity problems mentioned above.
Reviewed by: andre
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 438bcf8..77413cb 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1110,10 +1110,9 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td) * 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 && - (0x1 << tp->request_r_scale) < tcp_minmss) + (TCP_MAXWIN << tp->request_r_scale) < sb_max) tp->request_r_scale++; soisconnecting(so); |