sockets: Fix free-select-locked after udp close

ESP_LWIP supports closing socket while waiting. This fixes potential
races.
Orig: fix bug for after udp close select_waiting assert (dd3b3017)

Ref IDF-4794
This commit is contained in:
xueyunfei
2022-08-16 10:47:51 +02:00
committed by David Cermak
parent 83edc19882
commit 66666948f9
+3
View File
@@ -565,6 +565,9 @@ free_socket_locked(struct lwip_sock *sock, int is_tcp, struct netconn **conn,
*lastdata = sock->lastdata; *lastdata = sock->lastdata;
sock->lastdata.pbuf = NULL; sock->lastdata.pbuf = NULL;
#if ESP_LWIP
sock->select_waiting = 0;
#endif /* ESP_LWIP */
*conn = sock->conn; *conn = sock->conn;
sock->conn = NULL; sock->conn = NULL;
return 1; return 1;