mirror of
https://github.com/espressif/esp-lwip.git
synced 2026-08-22 01:40:04 +00:00
lower the dhcp discover and request retry backoff time
This commit is contained in:
@@ -112,7 +112,7 @@ static inline u32_t timeout_from_offered(u32_t lease, u32_t min, u32_t max)
|
||||
#define DHCP_CALC_TIMEOUT_FROM_OFFERED_T0_LEASE(dhcp) timeout_from_offered((dhcp)->offered_t0_lease, 0, 0xffff)
|
||||
#define DHCP_CALC_TIMEOUT_FROM_OFFERED_T1_RENEW(dhcp) timeout_from_offered((dhcp)->offered_t1_renew, 0, 0xffff)
|
||||
#define DHCP_CALC_TIMEOUT_FROM_OFFERED_T2_REBIND(dhcp) timeout_from_offered((dhcp)->offered_t2_rebind, 0, 0xffff)
|
||||
#define DHCP_REQUEST_TIMEOUT_SEQUENCE(state, tries) (u16_t)(((tries) < 6 ? 1 << (tries) : 60) * 1000)
|
||||
#define DHCP_REQUEST_TIMEOUT_SEQUENCE(tries) ((u16_t)(((tries) < 6 ? 1 << (tries) : 60) * 1000))
|
||||
|
||||
#endif /* DHCP_DEFINE_CUSTOM_TIMEOUTS */
|
||||
|
||||
@@ -513,7 +513,7 @@ dhcp_select(struct netif *netif)
|
||||
if (dhcp->tries < 255) {
|
||||
dhcp->tries++;
|
||||
}
|
||||
msecs = DHCP_REQUEST_TIMEOUT_SEQUENCE(DHCP_STATE_REQUESTING, dhcp->tries);
|
||||
msecs = DHCP_REQUEST_TIMEOUT_SEQUENCE(dhcp->tries);
|
||||
dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS);
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_select(): set request timeout %"U16_F" msecs\n", msecs));
|
||||
ESP_LWIP_DHCP_FINE_TIMER_START_ONCE(netif, dhcp);
|
||||
@@ -1277,7 +1277,7 @@ dhcp_discover(struct netif *netif)
|
||||
autoip_start(netif);
|
||||
}
|
||||
#endif /* LWIP_DHCP_AUTOIP_COOP */
|
||||
msecs = DHCP_REQUEST_TIMEOUT_SEQUENCE(DHCP_STATE_SELECTING, dhcp->tries);
|
||||
msecs = DHCP_REQUEST_TIMEOUT_SEQUENCE(dhcp->tries);
|
||||
dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS);
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover(): set request timeout %"U16_F" msecs\n", msecs));
|
||||
ESP_LWIP_DHCP_FINE_TIMER_START_ONCE(netif, dhcp);
|
||||
|
||||
Reference in New Issue
Block a user