diff --git a/Config.uk b/Config.uk index 05d1233..3d9eaaf 100644 --- a/Config.uk +++ b/Config.uk @@ -267,6 +267,17 @@ config LWIP_NUM_TCPCON config LWIP_NUM_TCPLISTENERS int "Maximum number of simultaneous TCP listeners" default 64 + +config LWIP_TCP_MSL + int "Maximum segment lifetime (ms)" + default 60000 + help + The maximum segment lifetime in milliseconds, used to determine + the TIME_WAIT timeout (2 * TCP_MSL). Connections remain in + TIME_WAIT state for this duration after closing, consuming + resources. Lower values allow faster connection recycling at the + cost of potential duplicate packet issues. Default is 60000 (60s), + resulting in a 120s TIME_WAIT. endif config LWIP_ICMP diff --git a/include/lwipopts.h b/include/lwipopts.h index 710c160..d0da9e9 100644 --- a/include/lwipopts.h +++ b/include/lwipopts.h @@ -162,6 +162,7 @@ void sys_free(void *ptr); #if LWIP_TCP #define TCP_MSS CONFIG_LWIP_TCP_MSS +#define TCP_MSL ((u32_t)CONFIG_LWIP_TCP_MSL) #define TCP_CALCULATE_EFF_SEND_MSS 1 #define IP_FRAG 0