Remove all CONFIG_NET_HAVE_REUSEADDR guard

This commit is contained in:
Xiang Xiao 2020-02-04 01:04:09 +08:00 committed by Gregory Nutt
parent 1d6fcfac13
commit e0adf5ee0b
2 changed files with 0 additions and 6 deletions

View File

@ -1174,12 +1174,10 @@ static FAR struct ftpd_server_s *ftpd_openserver(int port, sa_family_t family)
return NULL;
}
#ifdef CONFIG_NET_HAVE_REUSEADDR
{
int reuse = 1;
setsockopt(server->sd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
}
#endif
/* Bind the socket to the address */

View File

@ -78,9 +78,7 @@ int netlib_listenon(uint16_t portno)
{
struct sockaddr_in myaddr;
int listensd;
#ifdef CONFIG_NET_HAVE_REUSEADDR
int optval;
#endif
/* Create a new TCP socket to use to listen for connections */
@ -93,14 +91,12 @@ int netlib_listenon(uint16_t portno)
/* Set socket to reuse address */
#ifdef CONFIG_NET_HAVE_REUSEADDR
optval = 1;
if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0)
{
nerr("ERROR: setsockopt SO_REUSEADDR failure: %d\n", errno);
goto errout_with_socket;
}
#endif
/* Bind the socket to a local address */