From 8291ff3dc07fb96a110efe7c449ee46b8897e403 Mon Sep 17 00:00:00 2001 From: Freddie Chopin Date: Fri, 26 Jul 2019 16:44:12 +0200 Subject: [PATCH] Fix definition of LWIP_NUM_SYS_TIMEOUT_INTERNAL In timeouts.c commit 7d1c26cc0c18d02cc72f348f9189dd1c3a06bfca replaced timeout for AUTOIP with a timeout for ACD, however the value of LWIP_NUM_SYS_TIMEOUT_INTERNAL was not updated and still counts LWIP_AUTOIP instead of LWIP_ACD. If user has AUTOIP disabled (or not explicitly enabled) and DHCP enabled, then ACD gets automatically enabled too. In this case there will be one timeout too little for lwIP and first TCP packet received causes an assertion. Also add LWIP_IPV6_DHCP6 to the value of LWIP_NUM_SYS_TIMEOUT_INTERNAL, as it was also not accounted for. --- src/include/lwip/opt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 84f2b645..c4a1298f 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -505,7 +505,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 + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD))) +#define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_ACD + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD + LWIP_IPV6_DHCP6))) /** * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts.