sdk_wifi_station_dhcpc_stop: ensure the client is flagged as stopped.
Need to flag the dhcp client as stopped, even if the netif is not yet initialized, because the flag is used to control the starting of the dhcpc.
This commit is contained in:
parent
782eaabb97
commit
6db5525fbb
1 changed files with 3 additions and 3 deletions
|
@ -563,12 +563,12 @@ bool sdk_wifi_station_dhcpc_stop(void) {
|
||||||
if (sdk_wifi_get_opmode() == 2) {
|
if (sdk_wifi_get_opmode() == 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (netif && sdk_dhcpc_flag == DHCP_STARTED) {
|
|
||||||
LOCK_TCPIP_CORE();
|
LOCK_TCPIP_CORE();
|
||||||
|
if (netif && sdk_dhcpc_flag == DHCP_STARTED) {
|
||||||
dhcp_stop(netif);
|
dhcp_stop(netif);
|
||||||
|
}
|
||||||
sdk_dhcpc_flag = DHCP_STOPPED;
|
sdk_dhcpc_flag = DHCP_STOPPED;
|
||||||
UNLOCK_TCPIP_CORE();
|
UNLOCK_TCPIP_CORE();
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue