From ff54ae22f72815827e3f6862cb791501e309081b Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 2 Nov 2022 14:50:34 +0800 Subject: [PATCH] lwip: fix the bug that long time to get IP Closes WIFI-4932 --- components/lwip/lwip | 2 +- components/lwip/port/esp32/include/lwipopts.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/lwip/lwip b/components/lwip/lwip index c3e9aa1cef..33912690ea 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit c3e9aa1cef98fd8d87dabadc472c5268eae28319 +Subproject commit 33912690ea005e8ff05b2c579ebbf0a4189c3b00 diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index 5aea213f77..f30838cb1a 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -344,7 +344,9 @@ extern "C" { /* Since for embedded devices it's not that hard to miss a discover packet, so lower * the discover retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,8,15,15)s. */ -#define DHCP_REQUEST_TIMEOUT_SEQUENCE(tries) (( (tries) < 6 ? 1 << (tries) : 60) * 250) +#define DHCP_REQUEST_TIMEOUT_SEQUENCE(state, tries) (state == DHCP_STATE_REQUESTING ? \ + (uint16_t)(1 * 1000) : \ + (uint16_t)(((tries) < 6 ? 1 << (tries) : 60) * 250)) static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) {