Skip to content

Commit 5982674

Browse files
rtrbtMattiasTF
authored andcommitted
ETH: Do not enable DHCP by default.
Leaving DHCP enabled by default leads to race conditions during address configuration. Disable it by default because it can be turned on if actually required. As this fixes the race condition, the 50ms delay to work around it isn't required anymore.
1 parent 14d5e5b commit 5982674

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

libraries/Ethernet/src/ETH.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
330330
esp_netif_config.if_key = if_key_str;
331331
esp_netif_config.if_desc = if_desc_str;
332332
esp_netif_config.route_prio -= _eth_index * 5;
333+
esp_netif_config.flags = (esp_netif_flags_t)(esp_netif_config.flags & ~ESP_NETIF_DHCP_CLIENT);
333334

334335
cfg.base = &esp_netif_config;
335336

@@ -418,10 +419,6 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
418419
}
419420
}
420421

421-
// holds a few milliseconds to let DHCP start and enter into a good state
422-
// FIX ME -- addresses issue https://github.com/espressif/arduino-esp32/issues/5733
423-
delay(50);
424-
425422
return true;
426423

427424
err:

0 commit comments

Comments
 (0)