changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: devip: if the server does not support TCP ws option, disable window scaling (thanks joe9)

changeset 7252: 523d2d3e473f
parent 7251: c67d805b0614
child 7253: 986e26228cfe
author: cinap_lenrek@felloff.net
date: Wed, 22 May 2019 22:20:31 +0200
files: sys/src/9/ip/tcp.c
description: 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.
     1.1--- a/sys/src/9/ip/tcp.c
     1.2+++ b/sys/src/9/ip/tcp.c
     1.3@@ -3031,6 +3031,12 @@ procsyn(Conv *s, Tcp *seg)
     1.4 		tpriv->stats[Mss] = tcb->mss;
     1.5 	}
     1.6 
     1.7+	/* if the server does not support ws option, disable window scaling */
     1.8+	if(seg->ws == 0){
     1.9+		tcb->scale = 0;
    1.10+		tcb->snd.scale = 0;
    1.11+	}
    1.12+
    1.13 	tcb->snd.wnd = seg->wnd;
    1.14 	initialwindow(tcb);
    1.15 }