mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-10 01:23:48 +08:00
fixed bug #41318 (Bad memory ref in tcp_input() after tcp_close())
This commit is contained in:
@@ -193,7 +193,12 @@ tcp_close_shutdown(struct tcp_pcb *pcb, u8_t rst_on_unacked_data)
|
||||
TCP_REG(&tcp_tw_pcbs, pcb);
|
||||
} else {
|
||||
/* CLOSE_WAIT: deallocate the pcb since we already sent a RST for it */
|
||||
memp_free(MEMP_TCP_PCB, pcb);
|
||||
if (tcp_input_pcb == pcb) {
|
||||
/* prevent using a deallocated pcb: free it from tcp_input later */
|
||||
tcp_trigger_input_pcb_close();
|
||||
} else {
|
||||
memp_free(MEMP_TCP_PCB, pcb);
|
||||
}
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
@@ -1767,4 +1767,10 @@ tcp_parseopt(struct tcp_pcb *pcb)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tcp_trigger_input_pcb_close(void)
|
||||
{
|
||||
recv_flags |= TF_CLOSED;
|
||||
}
|
||||
|
||||
#endif /* LWIP_TCP */
|
||||
|
||||
Reference in New Issue
Block a user