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.

This commit is contained in:
goldsimon 2007-11-01 16:53:43 +00:00
parent 298d5cf042
commit 2d5908f4de
3 changed files with 11 additions and 2 deletions

View File

@ -435,6 +435,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

View File

@ -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;

View File

@ -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;