diff --git a/contrib/examples/example_app/lwipopts.h b/contrib/examples/example_app/lwipopts.h index d0ce0bd1..9c2a9fca 100644 --- a/contrib/examples/example_app/lwipopts.h +++ b/contrib/examples/example_app/lwipopts.h @@ -242,8 +242,9 @@ a lot of data that needs to be copied, this should be set high. */ /* 1 if you want to do an ARP check on the offered address (recommended). */ +#ifndef DHCP_DOES_ARP_CHECK #define DHCP_DOES_ARP_CHECK (LWIP_DHCP) - +#endif /* ---------- AUTOIP options ------- */ #define LWIP_AUTOIP (LWIP_DHCP) diff --git a/src/core/timeouts.c b/src/core/timeouts.c index 9ab96741..af7ee2e6 100644 --- a/src/core/timeouts.c +++ b/src/core/timeouts.c @@ -93,7 +93,7 @@ const struct lwip_cyclic_timer lwip_cyclic_timers[] = { #if LWIP_DHCP && !ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND {DHCP_FINE_TIMER_MSECS, HANDLER(dhcp_fine_tmr)}, #endif /* LWIP_DHCP && !ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND */ -#if LWIP_ACD +#if LWIP_ACD && !DHCP_DOES_ARP_CHECK {ACD_TMR_INTERVAL, HANDLER(acd_tmr)}, #endif /* LWIP_ACD */ #if LWIP_IGMP && !ESP_LWIP_IGMP_TIMERS_ONDEMAND diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 733e0ce3..32078138 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -498,7 +498,7 @@ * The number of sys timeouts used by the core stack (not apps) * The default number of timeouts is calculated here for all enabled modules. */ -#define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND ? LWIP_DHCP : 2*LWIP_DHCP) + LWIP_ACD + (ESP_LWIP_IGMP_TIMERS_ONDEMAND ? 0 : LWIP_IGMP) + (ESP_LWIP_DNS_TIMERS_ONDEMAND ? 0 : LWIP_DNS) + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + (ESP_LWIP_MLD6_TIMERS_ONDEMAND ? 0 : LWIP_IPV6_MLD) + LWIP_IPV6_DHCP6))) +#define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND ? LWIP_DHCP : 2*LWIP_DHCP) + (DHCP_DOES_ARP_CHECK ? 0 : LWIP_ACD) + (ESP_LWIP_IGMP_TIMERS_ONDEMAND ? 0 : LWIP_IGMP) + (ESP_LWIP_DNS_TIMERS_ONDEMAND ? 0 : LWIP_DNS) + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + (ESP_LWIP_MLD6_TIMERS_ONDEMAND ? 0 : LWIP_IPV6_MLD) + LWIP_IPV6_DHCP6))) /** * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. diff --git a/test/unit/lwipopts.h b/test/unit/lwipopts.h index 35b122c8..b73efcb2 100644 --- a/test/unit/lwipopts.h +++ b/test/unit/lwipopts.h @@ -169,6 +169,7 @@ u32_t esp_random(void); #define ESP_LWIP_DNS_TIMERS_ONDEMAND 1 #define ESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND 1 #define ESP_LWIP_IP6_REASSEMBLY_TIMERS_ONDEMAND 1 +#define DHCP_DOES_ARP_CHECK 1 #else #define ESP_LWIP 0 @@ -184,6 +185,10 @@ u32_t esp_random(void); #define ESP_LWIP_DNS_TIMERS_ONDEMAND 0 #endif +#ifndef DHCP_DOES_ARP_CHECK +#define DHCP_DOES_ARP_CHECK 0 +#endif + #ifndef ESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND #define ESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND 0 #endif /* ESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND */ diff --git a/test/unix/esp_lwipopts.h b/test/unix/esp_lwipopts.h index d1e3116d..7ca607b0 100644 --- a/test/unix/esp_lwipopts.h +++ b/test/unix/esp_lwipopts.h @@ -7,3 +7,4 @@ #define ESP_LWIP_MLD6_TIMERS_ONDEMAND ESP_LWIP #define ESP_DNS ESP_LWIP #define ESP_LWIP_ARP ESP_LWIP +#define DHCP_DOES_ARP_CHECK ESP_LWIP