From f13c986a208db54a23104933aef8980de032f1b2 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 2 Mar 2020 17:25:15 +1100 Subject: [PATCH] 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 --- src/core/tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/tcp.c b/src/core/tcp.c index 3f3aac94..c85ca5e2 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -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