You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/09/24 02:02:09 UTC
[incubator-nuttx] branch master updated: net/dup: only start tcp
monitor on INET domain
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 5a2510d net/dup: only start tcp monitor on INET domain
5a2510d is described below
commit 5a2510d48d953f1d8ed39bc0af3be23aea65fd12
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Sep 22 22:18:05 2021 +0800
net/dup: only start tcp monitor on INET domain
Signed-off-by: chao.an <an...@xiaomi.com>
---
net/socket/net_dup2.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/socket/net_dup2.c b/net/socket/net_dup2.c
index c36981f..2482936 100644
--- a/net/socket/net_dup2.c
+++ b/net/socket/net_dup2.c
@@ -104,7 +104,9 @@ int psock_dup2(FAR struct socket *psock1, FAR struct socket *psock2)
conn = (FAR struct tcp_conn_s *)psock2->s_conn;
- if (psock2->s_type == SOCK_STREAM && conn &&
+ if ((psock2->s_domain == PF_INET ||
+ psock2->s_domain == PF_INET6) &&
+ psock2->s_type == SOCK_STREAM && conn &&
(conn->tcpstateflags == TCP_ESTABLISHED ||
conn->tcpstateflags == TCP_SYN_RCVD))
{