tcp: Fix assertion if tcp_kill_state() is called from tcp_alloc() to clean FIN_WAIT sockets

As reported on GitHub: https://github.com/espressif/esp-idf/issues/1194#issuecomment-585251932
This commit is contained in:
Angus Gratton
2020-08-21 01:43:32 +08:00
committed by David Čermák
parent b1eec77be7
commit f13c986a20
+4
View File
@@ -1755,6 +1755,10 @@ tcp_kill_state(enum tcp_state state)
struct tcp_pcb *pcb, *inactive;
u32_t inactivity;
#if !ESP_LWIP
LWIP_ASSERT("invalid state", (state == CLOSING) || (state == LAST_ACK));
#endif
inactivity = 0;
inactive = NULL;
/* Go through the list of active pcbs and get the oldest pcb that is in state