Skip to content

Commit f8c2920

Browse files
committed
reformat previous patch to not use dhcp_stop in isr
1 parent ef10b70 commit f8c2920

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

connectivity/lwipstack/source/LWIPInterface.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ nsapi_error_t LWIP::Interface::set_dhcp()
169169

170170
#if LWIP_DHCP
171171
if (dhcp_has_to_be_set) {
172+
if(dhcp_started) {
173+
dhcp_stop(&netif);
174+
dhcp_started = false;
175+
}
176+
172177
err_t err = dhcp_start(&netif);
173178
dhcp_has_to_be_set = false;
174179
if (err) {
@@ -200,9 +205,7 @@ void LWIP::Interface::netif_link_irq(struct netif *netif)
200205
}
201206
} else {
202207
if(interface->dhcp_started) {
203-
interface->dhcp_started = false;
204208
interface->dhcp_has_to_be_set = true;
205-
dhcp_stop(netif);
206209
}
207210
osSemaphoreRelease(interface->unlinked);
208211
if (netif_is_up(&interface->netif)) {

0 commit comments

Comments
 (0)