From 4d4c6a36942a0c730940a15091fd91cd7a580010 Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Sun, 18 Sep 2016 16:43:48 +0800 Subject: [PATCH] Enable SO_REUSEADDR in LWIP --- components/lwip/include/lwip/port/lwipopts.h | 2 +- components/mbedtls/port/net.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lwip/include/lwip/port/lwipopts.h b/components/lwip/include/lwip/port/lwipopts.h index 65b3889f0b..99520f1cd9 100755 --- a/components/lwip/include/lwip/port/lwipopts.h +++ b/components/lwip/include/lwip/port/lwipopts.h @@ -405,7 +405,7 @@ extern unsigned char misc_prof_get_tcp_snd_buf(void); /** * SO_REUSE==1: Enable SO_REUSEADDR option. */ -#define SO_REUSE 0 +#define SO_REUSE 1 /* ---------------------------------------- diff --git a/components/mbedtls/port/net.c b/components/mbedtls/port/net.c index 482a11f970..45aa4b2deb 100644 --- a/components/mbedtls/port/net.c +++ b/components/mbedtls/port/net.c @@ -147,7 +147,7 @@ int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char /*SO_REUSEADDR option dafault is disable in source code(lwip)*/ #if SO_REUSE - n = 1; + int n = 1; if ( setsockopt( ctx->fd, SOL_SOCKET, SO_REUSEADDR, (const char *) &n, sizeof( n ) ) != 0 ) { close( ctx->fd ); -- 2.40.0