mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
tcpip_adapter: set sta ip to IP_ADDR_ANY when sta disconnect from ap
When sta is disconnected from AP, set sta ip to IP_ADDR_ANY to trigger lwip to clean up all TCP/UDP pcbs.
This commit is contained in:
parent
226e64bd1e
commit
67e8b3bcaf
@ -161,6 +161,9 @@ esp_err_t tcpip_adapter_down(tcpip_adapter_if_t tcpip_if)
|
||||
ip4_addr_set_zero(&esp_ip[tcpip_if].netmask);
|
||||
}
|
||||
|
||||
/* Modify ip address to trigger tcp/udp pcb cleanup */
|
||||
netif_set_addr(esp_netif[tcpip_if], IP4_ADDR_ANY, IP4_ADDR_ANY, IP4_ADDR_ANY);
|
||||
|
||||
netif_set_down(esp_netif[tcpip_if]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user