Merge branch 'features/lwip-SO_REUSEADDR' into 'master'

Enable SO_REUSEADDR in LWIP

Daniel initially asked me why this wasn't enabled, and I don't think I got any reasons against enabling this. If any, it makes porting existing software easier. Tuan needs it for UDP multicast as well.

Code changes are by Tuan: basically the enable for SO_REUSEADDR in LWIP as well as a bugfix in a bit of mbedTLS that gets enabled.

See merge request !90
pull/21/head
Jeroen Domburg 2016-09-19 10:42:35 +08:00
commit dfab57cd93
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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
/*
----------------------------------------

Wyświetl plik

@ -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 );