Fixed rare crash of DHCP Server during WIFI AP network reconfiguration and DHCP restart due to missed callback

Signed-off-by: xueyunfei <xueyunfei@espressif.com>
This commit is contained in:
Alex Winter 2019-05-14 02:30:32 +03:00 committed by xueyunfei
parent 613ba4c015
commit faf23c095c

View File

@ -808,6 +808,7 @@ esp_err_t tcpip_adapter_dhcps_start(tcpip_adapter_if_t tcpip_if)
if (p_netif != NULL && netif_is_up(p_netif)) {
tcpip_adapter_ip_info_t default_ip;
tcpip_adapter_get_ip_info(ESP_IF_WIFI_AP, &default_ip);
dhcps_set_new_lease_cb(tcpip_adapter_dhcps_cb);
dhcps_start(p_netif, default_ip.ip);
dhcps_status = TCPIP_ADAPTER_DHCP_STARTED;
ESP_LOGD(TAG, "dhcp server start successfully");