From 98f98048bc2da13d9b65fb51ab0d5a76b27649f9 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 28 Aug 2015 11:23:24 +0200 Subject: [PATCH] TCP window scaling: don't parse window scaling option on retransmission --- src/core/tcp_in.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 6de74033..19671281 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -1714,10 +1714,10 @@ tcp_parseopt(struct tcp_pcb *pcb) return; } /* If syn was received with wnd scale option, - activate wnd scale opt */ - data = tcp_getoptbyte(); - if (flags & TCP_SYN) { + activate wnd scale opt, but only if this is not a retransmission */ + if ((flags & TCP_SYN) && !(pcb->flags & TF_WND_SCALE)) { /* An WND_SCALE option with the right option length. */ + data = tcp_getoptbyte(); pcb->snd_scale = data; if (pcb->snd_scale > 14U) { pcb->snd_scale = 14U;