|
From: | Bram Peeters |
Subject: | [lwip-users] netconn_prepare_delete called twice when doing lwip_close leading to errno = EBADF |
Date: | Mon, 15 Mar 2021 15:53:22 +0000 |
Hi, When doing lwip close I get errno being set to EBADF. This happens with the following callstack: get_socket( “set_errno(EBADF);”
) event_callback() (“sock = get_socket(s);”) lwip_netconn_do_delconn (“API_EVENT(msg->conn,
NETCONN_EVT_RCVPLUS, 0)”)
<...> Upon investigation I think this is because in the lwip_close scenario netconn_prepare_delete is called twice. First time is directly from lwip_close-> netconn_prepare_delete Second time is via lwip_close-> free_socket-> free_socket_free_elements->
netconn_delete-> netconn_prepare_delete The second time could be avoided if LWIP_NETCONN_FULLDUPLEX is set in which case there is a test for it, but I see that is flag is in alpha state and if not needed it is a bit strange to enable it just for this ? But maybe I am misunderstanding something ? Regards, Bram |
[Prev in Thread] | Current Thread | [Next in Thread] |