From 316d3f9c4a82d2511521946533f0497215036f28 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 20 Sep 2016 15:36:55 +0800 Subject: [PATCH 1/2] components/lwip: make SO_REUSE configurable via menuconfig Not all environments need or can work with SO_REUSE enabled, so making this option configurable. --- components/lwip/Kconfig | 7 +++++++ components/lwip/include/lwip/port/lwipopts.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index 8f38ba931..911db6fff 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -16,6 +16,13 @@ config LWIP_THREAD_LOCAL_STORAGE_INDEX Specify the thread-local-storage-pointer index for lwip use. +config LWIP_SO_REUSE + bool "Enable SO_REUSEADDR option" + default 0 + help + Enabling this option allows to bind to a port which remains in + TIME_WAIT. + endmenu diff --git a/components/lwip/include/lwip/port/lwipopts.h b/components/lwip/include/lwip/port/lwipopts.h index 99520f1cd..2c24b2be9 100755 --- a/components/lwip/include/lwip/port/lwipopts.h +++ b/components/lwip/include/lwip/port/lwipopts.h @@ -34,6 +34,7 @@ #include #include "esp_task.h" +#include "sdkconfig.h" /* Enable all Espressif-only options */ #define LWIP_ESP8266 @@ -404,8 +405,9 @@ extern unsigned char misc_prof_get_tcp_snd_buf(void); /** * SO_REUSE==1: Enable SO_REUSEADDR option. + * This option is set via menuconfig. */ -#define SO_REUSE 1 +#define SO_REUSE CONFIG_LWIP_SO_REUSE /* ---------------------------------------- From 3b22173a938926a5d60a561e1e80ba6029012cf4 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 20 Sep 2016 16:53:56 +0800 Subject: [PATCH 2/2] components/lwip: fix grammar --- components/lwip/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index 911db6fff..ceb1453f9 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -20,7 +20,7 @@ config LWIP_SO_REUSE bool "Enable SO_REUSEADDR option" default 0 help - Enabling this option allows to bind to a port which remains in + Enabling this option allows binding to a port which remains in TIME_WAIT. endmenu