Remove all CONFIG_NET_HAVE_REUSEADDR guard
This commit is contained in:
parent
1d6fcfac13
commit
e0adf5ee0b
@ -1174,12 +1174,10 @@ static FAR struct ftpd_server_s *ftpd_openserver(int port, sa_family_t family)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NET_HAVE_REUSEADDR
|
|
||||||
{
|
{
|
||||||
int reuse = 1;
|
int reuse = 1;
|
||||||
setsockopt(server->sd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
|
setsockopt(server->sd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Bind the socket to the address */
|
/* Bind the socket to the address */
|
||||||
|
|
||||||
|
@ -78,9 +78,7 @@ int netlib_listenon(uint16_t portno)
|
|||||||
{
|
{
|
||||||
struct sockaddr_in myaddr;
|
struct sockaddr_in myaddr;
|
||||||
int listensd;
|
int listensd;
|
||||||
#ifdef CONFIG_NET_HAVE_REUSEADDR
|
|
||||||
int optval;
|
int optval;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Create a new TCP socket to use to listen for connections */
|
/* 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 */
|
/* Set socket to reuse address */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_HAVE_REUSEADDR
|
|
||||||
optval = 1;
|
optval = 1;
|
||||||
if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0)
|
if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0)
|
||||||
{
|
{
|
||||||
nerr("ERROR: setsockopt SO_REUSEADDR failure: %d\n", errno);
|
nerr("ERROR: setsockopt SO_REUSEADDR failure: %d\n", errno);
|
||||||
goto errout_with_socket;
|
goto errout_with_socket;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Bind the socket to a local address */
|
/* Bind the socket to a local address */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user