Skip to content

Commit 948e9bf

Browse files
Clear any existing IP before sending a DHCP request (#2979)
Fixes #2978
1 parent 73bd6a0 commit 948e9bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/lwIP_Ethernet/src/LwipIntfDev.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,10 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
393393
}
394394

395395
if (_isDHCP) {
396-
// IP not set, starting DHCP
396+
// Destroy any existing address
397+
ip4_addr_set_u32(ip_2_ip4(&_netif.ip_addr), 0);
398+
399+
// Start a new DHCP request
397400
_netif.flags |= NETIF_FLAG_UP;
398401
switch (dhcp_start(&_netif)) {
399402
case ERR_OK:

0 commit comments

Comments
 (0)