You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2022/11/22 11:45:33 UTC

[incubator-nuttx] 01/06: net/usrsock: Remove NET_USRSOCK_NO_INET[6]

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

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

commit c2f566afcb51b19184f967803ba64259f3c67aef
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Nov 20 06:58:44 2022 +0800

    net/usrsock: Remove NET_USRSOCK_NO_INET[6]
    
    let the remote peer do all final decision
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 net/usrsock/Kconfig          |  8 --------
 net/usrsock/usrsock_sockif.c | 37 -------------------------------------
 2 files changed, 45 deletions(-)

diff --git a/net/usrsock/Kconfig b/net/usrsock/Kconfig
index d5c2504c05..bfd3961e33 100644
--- a/net/usrsock/Kconfig
+++ b/net/usrsock/Kconfig
@@ -38,14 +38,6 @@ config NET_USRSOCK_NPOLLWAITERS
 	int "Number of usrsock poll waiters"
 	default 1
 
-config NET_USRSOCK_NO_INET
-	bool "Disable PF_INET for usrsock"
-	default n
-
-config NET_USRSOCK_NO_INET6
-	bool "Disable PF_INET6 for usrsock"
-	default n
-
 config NET_USRSOCK_UDP
 	bool "User-space daemon provides UDP sockets"
 	default n
diff --git a/net/usrsock/usrsock_sockif.c b/net/usrsock/usrsock_sockif.c
index b809286bf6..5791ec6e68 100644
--- a/net/usrsock/usrsock_sockif.c
+++ b/net/usrsock/usrsock_sockif.c
@@ -98,43 +98,6 @@ static int usrsock_sockif_setup(FAR struct socket *psock, int protocol)
   int type = psock->s_type;
   int ret;
 
-#ifdef CONFIG_NET_USRSOCK_NO_INET
-  if (domain == PF_INET)
-    {
-      return -ENETDOWN;
-    }
-#endif
-
-#ifdef CONFIG_NET_USRSOCK_NO_INET6
-  if (domain == PF_INET6)
-    {
-      return -ENETDOWN;
-    }
-#endif
-
-  if (domain == PF_INET || domain == PF_INET6)
-    {
-#ifndef CONFIG_NET_USRSOCK_UDP
-      if (type == SOCK_DGRAM)
-        {
-          return -ENETDOWN;
-        }
-#endif
-
-#ifndef CONFIG_NET_USRSOCK_TCP
-      if (type == SOCK_STREAM)
-        {
-          return -ENETDOWN;
-        }
-#endif
-    }
-  else
-    {
-#ifndef CONFIG_NET_USRSOCK_OTHER
-      return -ENETDOWN;
-#endif
-    }
-
   psock->s_type = PF_UNSPEC;
   psock->s_conn = NULL;