net/local: Support the abstract path to connect

Signed-off-by: yintao <yintao@xiaomi.com>
This commit is contained in:
yintao 2023-06-07 12:11:44 +08:00 committed by Xiang Xiao
parent 6a0ffa5c52
commit 7544b68aa9
3 changed files with 6 additions and 10 deletions

View File

@ -125,8 +125,7 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
server = psock->s_conn; server = psock->s_conn;
if (server->lc_proto != SOCK_STREAM || if (server->lc_proto != SOCK_STREAM ||
server->lc_state != LOCAL_STATE_LISTENING || server->lc_state != LOCAL_STATE_LISTENING)
server->lc_type != LOCAL_TYPE_PATHNAME)
{ {
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }

View File

@ -86,8 +86,7 @@ int local_listen(FAR struct socket *psock, int backlog)
/* Some sanity checks */ /* Some sanity checks */
if (server->lc_proto != SOCK_STREAM || if (server->lc_proto != SOCK_STREAM ||
server->lc_state == LOCAL_STATE_UNBOUND || server->lc_state == LOCAL_STATE_UNBOUND)
server->lc_type != LOCAL_TYPE_PATHNAME)
{ {
net_unlock(); net_unlock();
return -EOPNOTSUPP; return -EOPNOTSUPP;

View File

@ -168,9 +168,8 @@ int local_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
} }
#ifdef CONFIG_NET_LOCAL_STREAM #ifdef CONFIG_NET_LOCAL_STREAM
if ((conn->lc_state == LOCAL_STATE_LISTENING || if (conn->lc_state == LOCAL_STATE_LISTENING ||
conn->lc_state == LOCAL_STATE_CONNECTING) && conn->lc_state == LOCAL_STATE_CONNECTING)
conn->lc_type == LOCAL_TYPE_PATHNAME)
{ {
return local_event_pollsetup(conn, fds, true); return local_event_pollsetup(conn, fds, true);
} }
@ -322,9 +321,8 @@ int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds)
} }
#ifdef CONFIG_NET_LOCAL_STREAM #ifdef CONFIG_NET_LOCAL_STREAM
if ((conn->lc_state == LOCAL_STATE_LISTENING || if (conn->lc_state == LOCAL_STATE_LISTENING ||
conn->lc_state == LOCAL_STATE_CONNECTING) && conn->lc_state == LOCAL_STATE_CONNECTING)
conn->lc_type == LOCAL_TYPE_PATHNAME)
{ {
return local_event_pollsetup(conn, fds, false); return local_event_pollsetup(conn, fds, false);
} }