1
0
Fork 0
forked from nuttx/nuttx-update

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 <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng 2023-04-07 18:43:47 +08:00 committed by Petro Karashchenko
parent 6ca0f90d43
commit 9f8d587b64

View file

@ -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,