Commit 1965656a authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Always use REUSEADDR, not only in DEBUG

parent d7c64742
...@@ -66,12 +66,10 @@ static int fd_setsockopt_prebind(int sk) ...@@ -66,12 +66,10 @@ static int fd_setsockopt_prebind(int sk)
CHECK_PARAMS( sk > 0 ); CHECK_PARAMS( sk > 0 );
#ifdef DEBUG
{ {
int reuse = 1; int reuse = 1;
CHECK_SYS( setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)) ); CHECK_SYS( setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)) );
} }
#endif /* DEBUG */
#ifdef ADJUST_RTX_PARAMS #ifdef ADJUST_RTX_PARAMS
/* Set the retransmit parameters */ /* Set the retransmit parameters */
......
...@@ -80,13 +80,10 @@ static int fd_tcp_setsockopt(int family, int sk) ...@@ -80,13 +80,10 @@ static int fd_tcp_setsockopt(int family, int sk)
} }
#endif /* IPV6_V6ONLY */ #endif /* IPV6_V6ONLY */
#ifdef DEBUG
{ {
opt = 1; opt = 1;
CHECK_SYS( setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) ); CHECK_SYS( setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) );
} }
#endif /* DEBUG */
/* There are also others sockopt that can be set, but nothing useful for us AFAICT */ /* There are also others sockopt that can be set, but nothing useful for us AFAICT */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment