From 85bf17d7e2e911f3941a55b8d4af7082c52361a2 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Tue, 6 Dec 2022 15:37:30 +0800 Subject: [PATCH] lwip: fix the bug that long time to get IP --- components/lwip/lwip | 2 +- components/lwip/port/esp32/include/lwipopts.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/lwip/lwip b/components/lwip/lwip index 79182163e9..6fa02bd30d 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit 79182163e9e77547e58a6aa34db94902b9812cb3 +Subproject commit 6fa02bd30daa656f896c7a36248253fb3b97660d diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index 151c0e3091..bbae6d4241 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -254,6 +254,14 @@ */ #define ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID +#define DHCP_DEFINE_CUSTOM_TIMEOUTS 1 +/* 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(state, tries) (state == DHCP_STATE_REQUESTING ? \ + (uint16_t)(1 * 1000) : \ + (uint16_t)(((tries) < 6 ? 1 << (tries) : 60) * 250)) + /* ------------------------------------ ---------- AUTOIP options ----------