diff options
| author | goldsimon <goldsimon> | 2007-11-01 16:53:43 +0000 |
|---|---|---|
| committer | goldsimon <goldsimon> | 2007-11-01 16:53:43 +0000 |
| commit | 2d5908f4dedeac4ae2f568bd6f06ea218de5a125 (patch) | |
| tree | e1c1d7413ab0dca17aabbe41524335a47ceb8b1c | |
| parent | 298d5cf042e5f6b26591e58e611860c51a2b8118 (diff) | |
| download | lwip-2d5908f4dedeac4ae2f568bd6f06ea218de5a125.tar.gz | |
Fixed bug #21494: The send mss (pcb->mss) is set to 536 (or TCP_MSS if that is smaller) as long as no MSS option is received from the remote host.
| -rw-r--r-- | CHANGELOG | 5 | ||||
| -rw-r--r-- | src/core/tcp.c | 4 | ||||
| -rw-r--r-- | src/core/tcp_in.c | 4 |
3 files changed, 11 insertions, 2 deletions
@@ -436,6 +436,11 @@ HISTORY ++ Bug fixes: 2007-11-01 Simon Goldschmidt + * tcp.c, tcp_in.c: Fixed bug #21494: The send mss (pcb->mss) is set to 536 (or + TCP_MSS if that is smaller) as long as no MSS option is received from the + remote host. + + 2007-11-01 Simon Goldschmidt * tcp.h, tcp.c, tcp_in.c: Fixed bug #21491: The MSS option sent (with SYN) is now based on TCP_MSS instead of pcb->mss (on passive open now effectively sending our configured TCP_MSS instead of the one received). diff --git a/src/core/tcp.c b/src/core/tcp.c index 1e23033..422f0eb 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -492,7 +492,7 @@ tcp_connect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port, pcb->rcv_wnd = TCP_WND; pcb->snd_wnd = TCP_WND; /* The send MSS is updated when an MSS option is received. */ - pcb->mss = TCP_MSS; + pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS; pcb->cwnd = 1; pcb->ssthresh = pcb->mss * 10; pcb->state = SYN_SENT; @@ -932,7 +932,7 @@ tcp_alloc(u8_t prio) pcb->tos = 0; pcb->ttl = TCP_TTL; /* The send MSS is updated when an MSS option is received. */ - pcb->mss = TCP_MSS; + pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS; pcb->rto = 3000 / TCP_SLOW_INTERVAL; pcb->sa = 0; pcb->sv = 3000 / TCP_SLOW_INTERVAL; diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 74e4f6f..d8d813c 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -519,6 +519,10 @@ tcp_process(struct tcp_pcb *pcb) * can be changed by the received options! */ tcp_parseopt(pcb); + /* Set ssthresh again after changing pcb->mss (already set in tcp_connect + * but for the default value of pcb->mss) */ + pcb->ssthresh = pcb->mss * 10; + pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss); LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0)); --pcb->snd_queuelen; |
