tcpip_adpater: set ip to zero in tcpip_adapter_down

In some cases, there will have "ip unchanged", and have no event posted
when station reconnected.
This commit is contained in:
Wu Jian Gang 2016-08-26 12:03:52 +08:00
parent cb33a0fb9b
commit 588d384393

View File

@ -155,6 +155,10 @@ esp_err_t tcpip_adapter_down(tcpip_adapter_if_t tcpip_if)
netif_set_down(esp_netif[tcpip_if]); netif_set_down(esp_netif[tcpip_if]);
netif_set_addr(esp_netif[tcpip_if], IP4_ADDR_ANY, IP4_ADDR_ANY, IP4_ADDR_ANY); netif_set_addr(esp_netif[tcpip_if], IP4_ADDR_ANY, IP4_ADDR_ANY, IP4_ADDR_ANY);
} }
ip4_addr_set_zero(&esp_ip[tcpip_if].ip);
ip4_addr_set_zero(&esp_ip[tcpip_if].gw);
ip4_addr_set_zero(&esp_ip[tcpip_if].netmask);
} }
return ESP_OK; return ESP_OK;