From 9f8d587b64da3dbbe0fa025f1b326b53504ddace Mon Sep 17 00:00:00 2001 From: Zhe Weng Date: Fri, 7 Apr 2023 18:43:47 +0800 Subject: [PATCH] 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 --- 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,