mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
net/usrsock: Remove NET_USRSOCK_NO_INET[6]
let the remote peer do all final decision Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
b4bab51e86
commit
c2f566afcb
@@ -38,14 +38,6 @@ config NET_USRSOCK_NPOLLWAITERS
|
|||||||
int "Number of usrsock poll waiters"
|
int "Number of usrsock poll waiters"
|
||||||
default 1
|
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
|
config NET_USRSOCK_UDP
|
||||||
bool "User-space daemon provides UDP sockets"
|
bool "User-space daemon provides UDP sockets"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -98,43 +98,6 @@ static int usrsock_sockif_setup(FAR struct socket *psock, int protocol)
|
|||||||
int type = psock->s_type;
|
int type = psock->s_type;
|
||||||
int ret;
|
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_type = PF_UNSPEC;
|
||||||
psock->s_conn = NULL;
|
psock->s_conn = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user