forked from espressif/esp-idf
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:
@@ -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);
|
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]);
|
netif_set_down(esp_netif[tcpip_if]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user