We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef10b70 commit f8c2920Copy full SHA for f8c2920
connectivity/lwipstack/source/LWIPInterface.cpp
@@ -169,6 +169,11 @@ nsapi_error_t LWIP::Interface::set_dhcp()
169
170
#if LWIP_DHCP
171
if (dhcp_has_to_be_set) {
172
+ if(dhcp_started) {
173
+ dhcp_stop(&netif);
174
+ dhcp_started = false;
175
+ }
176
+
177
err_t err = dhcp_start(&netif);
178
dhcp_has_to_be_set = false;
179
if (err) {
@@ -200,9 +205,7 @@ void LWIP::Interface::netif_link_irq(struct netif *netif)
200
205
}
201
206
} else {
202
207
if(interface->dhcp_started) {
203
- interface->dhcp_started = false;
204
208
interface->dhcp_has_to_be_set = true;
- dhcp_stop(netif);
209
210
osSemaphoreRelease(interface->unlinked);
211
if (netif_is_up(&interface->netif)) {
0 commit comments