mirror of https://github.com/ARMmbed/mbed-os.git
Issue: The problem is that there is a race condition introduced in that the LWIP thread is relying on the interface as it is taken down by a application thread while calling disconnect. In disconnect api called from application context, whd_emac_wifi_link_state_changed() will refer to netif interface structure in its callback api netif_link_irq(netif). This netif will be cleared by remove_etherent_interface(). whd_emac_wifi_link_state_changed will post message to tcpip_thread. tcpip_thread will process the message and call the callback api netif_link_irq(netif) Calling sequence is whd_emac_wifi_link_state_changed -> remove_etherent_interface(). Hence there is a timing issue that netif might be cleared first before tcpip thread process the message netif_link_irq(netif) Fix: remove_etherent_interface() will post message to tcpip thread and tcpip: thread process the message delete_interface() which will actually remove the inferface from the netif_list. Calling sequence is whd_emac_wifi_link_state_changed() message post -> remove_etherent_interface() message post. message processing order netif_link_irq(netif) -> delete_interface(). Since both the processing is handled in single thread, processing of message is handled sequentially. |
||
---|---|---|
.. | ||
lwip | ||
lwip-sys | ||
.mbedignore | ||
CONTRIBUTING.md | ||
LWIPInterface.cpp | ||
LWIPInterfaceEMAC.cpp | ||
LWIPInterfaceL3IP.cpp | ||
LWIPInterfacePPP.cpp | ||
LWIPMemoryManager.cpp | ||
LWIPMemoryManager.h | ||
LWIPStack.cpp | ||
LWIPStack.h | ||
lwip_tools.cpp | ||
lwip_tools.h | ||
lwipopts.h | ||
mbed_lib.json |