This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 9f8d587b64 net/rpmsg: Set family for rpaddr in ns_bind
9f8d587b64 is described below
commit 9f8d587b64da3dbbe0fa025f1b326b53504ddace
Author: Zhe Weng <[email protected]>
AuthorDate: Fri Apr 7 18:43:47 2023 +0800
net/rpmsg: Set family for rpaddr in ns_bind
The rpmsg addr get from socket accept has rp_family=0, which is not
intended, to avoid wrong logic in other place, set the rp_family
in ns_bind function.
Signed-off-by: Zhe Weng <[email protected]>
---
net/rpmsg/rpmsg_sockif.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c
index 583f8d9b33..da150f783b 100644
--- a/net/rpmsg/rpmsg_sockif.c
+++ b/net/rpmsg/rpmsg_sockif.c
@@ -518,6 +518,7 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device
*rdev,
return;
}
+ new->rpaddr.rp_family = AF_RPMSG;
strlcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev),
sizeof(new->rpaddr.rp_cpu));
strlcpy(new->rpaddr.rp_name, name + RPMSG_SOCKET_NAME_PREFIX_LEN,