mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-16 14:11:02 +00:00
Fix corner case with dhcp timeouts
If t1 >= t2 timeout then only t2 timer should be scheduled. This can happen when a sub 1 minute lease is received.
This commit is contained in:
parent
03fb581252
commit
3db149b42e
@ -962,6 +962,11 @@ dhcp_bind(struct netif *netif)
|
|||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind*1000));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind*1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we have sub 1 minute lease, t2 and t1 will kick in at the same time. */
|
||||||
|
if (dhcp->t1_timeout >= dhcp->t2_timeout && dhcp->t2_timeout > 0) {
|
||||||
|
dhcp->t1_timeout = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (dhcp->subnet_mask_given) {
|
if (dhcp->subnet_mask_given) {
|
||||||
/* copy offered network mask */
|
/* copy offered network mask */
|
||||||
ip_addr_copy(sn_mask, dhcp->offered_sn_mask);
|
ip_addr_copy(sn_mask, dhcp->offered_sn_mask);
|
||||||
|
Loading…
Reference in New Issue
Block a user