]> granicus.if.org Git - esp-idf/commitdiff
components/lwip: make SO_REUSE configurable via menuconfig
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 20 Sep 2016 07:36:55 +0000 (15:36 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 20 Sep 2016 07:36:55 +0000 (15:36 +0800)
Not all environments need or can work with SO_REUSE enabled, so making this option configurable.

components/lwip/Kconfig
components/lwip/include/lwip/port/lwipopts.h

index 8f38ba93102f053fdaf680707a2be8d34c5976ea..911db6fff42c308ed8fed2c1d38043c5dad65c19 100644 (file)
@@ -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
 
 
index 99520f1cd9d9286c8b4ac81c46809923f1a35cde..2c24b2be92e082eac22a5ceb8efe56ca85b7219d 100755 (executable)
@@ -34,6 +34,7 @@
 
 #include <stdlib.h>
 #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
 
 /*
    ----------------------------------------