From 853765954e6f38d967bed79ba7fb46e61f48311b Mon Sep 17 00:00:00 2001 From: goldsimon Date: Thu, 1 Nov 2007 15:51:43 +0000 Subject: [PATCH] Fixed bug #21181: On active open, the initial congestion window was calculated based on the configured TCP_MSS, not on the MSS option received with SYN+ACK. --- CHANGELOG | 5 +++++ src/core/tcp_in.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index da2c6105..0344751c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -435,6 +435,11 @@ HISTORY ++ Bug fixes: + 2007-10-09 Simon Goldschmidt + * tcp_in.c: Fixed bug #21181: On active open, the initial congestion window was + calculated based on the configured TCP_MSS, not on the MSS option received + with SYN+ACK. + 2007-10-09 Simon Goldschmidt * udp.c, inet.c, inet.h: Fixed UDPLite: send: Checksum was always generated too short and also was generated wrong if checksum coverage != tot_len; diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index fa061f21..369f0b7f 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -517,6 +517,11 @@ tcp_process(struct tcp_pcb *pcb) pcb->snd_wnd = tcphdr->wnd; pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */ pcb->state = ESTABLISHED; + + /* Parse any options in the SYNACK before using pcb->mss since that + * can be changed by the received options! */ + tcp_parseopt(pcb); + pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss); LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0)); --pcb->snd_queuelen; @@ -533,9 +538,6 @@ tcp_process(struct tcp_pcb *pcb) tcp_seg_free(rseg); - /* Parse any options in the SYNACK. */ - tcp_parseopt(pcb); - /* Call the user specified function to call when sucessfully * connected. */ TCP_EVENT_CONNECTED(pcb, ERR_OK, err);