]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
TCP window scaling: don't parse window scaling option on retransmission
authorgoldsimon <goldsimon@gmx.de>
Fri, 28 Aug 2015 09:23:24 +0000 (11:23 +0200)
committergoldsimon <goldsimon@gmx.de>
Fri, 28 Aug 2015 09:23:24 +0000 (11:23 +0200)
src/core/tcp_in.c

index 6de740332070076df576d2dc06d0eac0a4bf5840..196712818a9a1725dc223f4874f91268b8ab2de7 100644 (file)
@@ -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;