You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/02/03 21:12:29 UTC

[incubator-nuttx-apps] branch pr47 updated: Remove all CONFIG_NET_HAVE_REUSEADDR guard

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch pr47
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/pr47 by this push:
     new 9738e0b  Remove all CONFIG_NET_HAVE_REUSEADDR guard
9738e0b is described below

commit 9738e0be37cf28224d8e7c25889ba5ed4afe6a8c
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Feb 4 01:04:09 2020 +0800

    Remove all CONFIG_NET_HAVE_REUSEADDR guard
    
    Change-Id: I24990bbec8cc4d6d0f06899bec45c575dd35b77f
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 netutils/ftpd/ftpd.c              | 2 --
 netutils/netlib/netlib_listenon.c | 4 ----
 2 files changed, 6 deletions(-)

diff --git a/netutils/ftpd/ftpd.c b/netutils/ftpd/ftpd.c
index e9b9286..cf08733 100644
--- a/netutils/ftpd/ftpd.c
+++ b/netutils/ftpd/ftpd.c
@@ -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 */
 
diff --git a/netutils/netlib/netlib_listenon.c b/netutils/netlib/netlib_listenon.c
index a4bc1f2..11e818e 100644
--- a/netutils/netlib/netlib_listenon.c
+++ b/netutils/netlib/netlib_listenon.c
@@ -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 */