mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-14 08:53:56 +08:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user