mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +00:00
dhcp: don't set a default gateway if dhcp server doesn't give one
see bug #60578
This commit is contained in:
parent
919dc2019a
commit
a8e8ce4108
@ -1113,13 +1113,6 @@ dhcp_bind(struct netif *netif)
|
||||
}
|
||||
|
||||
ip4_addr_copy(gw_addr, dhcp->offered_gw_addr);
|
||||
/* gateway address not given? */
|
||||
if (ip4_addr_isany_val(gw_addr)) {
|
||||
/* copy network address */
|
||||
ip4_addr_get_network(&gw_addr, &dhcp->offered_ip_addr, &sn_mask);
|
||||
/* use first host address on network as gateway */
|
||||
ip4_addr_set_u32(&gw_addr, ip4_addr_get_u32(&gw_addr) | PP_HTONL(0x00000001UL));
|
||||
}
|
||||
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): IP: 0x%08"X32_F" SN: 0x%08"X32_F" GW: 0x%08"X32_F"\n",
|
||||
ip4_addr_get_u32(&dhcp->offered_ip_addr), ip4_addr_get_u32(&sn_mask), ip4_addr_get_u32(&gw_addr)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user