mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
* tcp_in.c: Fix for bug #19953 - correct TCP state machine when
* receiving FIN+ACK in SYN_RECV state
This commit is contained in:
parent
40ef282982
commit
a6ca9aa306
@ -568,14 +568,20 @@ tcp_process(struct tcp_pcb *pcb)
|
|||||||
old_cwnd = pcb->cwnd;
|
old_cwnd = pcb->cwnd;
|
||||||
/* If there was any data contained within this ACK,
|
/* If there was any data contained within this ACK,
|
||||||
* we'd better pass it on to the application as well. */
|
* we'd better pass it on to the application as well. */
|
||||||
tcp_receive(pcb);
|
accepted_inseq = tcp_receive(pcb);
|
||||||
|
|
||||||
pcb->cwnd = ((old_cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
|
pcb->cwnd = ((old_cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
|
||||||
|
|
||||||
|
if ((flags & TCP_FIN) && accepted_inseq) {
|
||||||
|
tcp_ack_now(pcb);
|
||||||
|
pcb->state = CLOSE_WAIT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* incorrect ACK number */
|
/* incorrect ACK number */
|
||||||
else {
|
else {
|
||||||
/* send RST */
|
/* send RST */
|
||||||
tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
|
tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
|
||||||
tcphdr->dest, tcphdr->src);
|
tcphdr->dest, tcphdr->src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user