From 197ff3ac2f4fe9be7eefc9c8409cee04e267b04a Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 22 May 2019 22:20:31 +0200 Subject: [PATCH] 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. --- sys/src/9/ip/tcp.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); }