summaryrefslogtreecommitdiff
path: root/sys/src/9/ip
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-05-22 22:20:31 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-05-22 22:20:31 +0200
commit197ff3ac2f4fe9be7eefc9c8409cee04e267b04a (patch)
treea4a8231976ee82ed315c7f3a3f754b96e487adef /sys/src/9/ip
parentd7aa56c073abea325fb52821b49fa453bacd3922 (diff)
devip: if the server does not support TCP ws option, disable window scaling (thanks joe9)
if the server responds without a window scale option in its syn-ack, disable window scaling alltogether as both sides need to understand the option.
Diffstat (limited to 'sys/src/9/ip')
-rw-r--r--sys/src/9/ip/tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/src/9/ip/tcp.c b/sys/src/9/ip/tcp.c
index 775d1b1ce..8d0195ac3 100644
--- a/sys/src/9/ip/tcp.c
+++ b/sys/src/9/ip/tcp.c
@@ -3031,6 +3031,12 @@ procsyn(Conv *s, Tcp *seg)
tpriv->stats[Mss] = tcb->mss;
}
+ /* if the server does not support ws option, disable window scaling */
+ if(seg->ws == 0){
+ tcb->scale = 0;
+ tcb->snd.scale = 0;
+ }
+
tcb->snd.wnd = seg->wnd;
initialwindow(tcb);
}