tcp_in/ooseq: Fix incorrect segment trim when FIN moved

2.1.3-esp: 9e62afff tcp_in/ooseq: Fix incorrect segment trim when FIN moved
This commit is contained in:
xueyunfei
2023-02-15 11:25:33 +08:00
committed by David Cermak
parent d6a2a9c022
commit a1a9b0346b
+4 -1
View File
@@ -1544,9 +1544,12 @@ tcp_receive(struct tcp_pcb *pcb)
if (next &&
TCP_SEQ_GT(seqno + tcplen,
next->tcphdr->seqno)) {
/* inseg cannot have FIN here (already processed above) */
inseg.len = (u16_t)(next->tcphdr->seqno - seqno);
#if ESP_LWIP
if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN || TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
#else
if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) {
#endif
inseg.len -= 1;
}
pbuf_realloc(inseg.p, inseg.len);