linux-user: pass sockaddr from host to target
PATCH v3 1/3 linux-user: pass sockaddr from host to target
Signed-off-by Jing Huang <[email protected]>
--- linux-user/syscall.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
linux-user/syscall.c +12 -1
@@ -1873,10 +1873,21 @@ static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,if (!is_error (ret)) { len = ret; ret =host_to_target_cmsg (msgp, &msg); -if (!is_error (ret)) +if (!is_error (ret)) { + msgp->msg_namelen =tswap32 (msg.msg_namelen); +if (msg.msg_name !=NULL ) { + ret =host_to_target_sockaddr (tswapal (msgp->msg_name), + msg.msg_name, msg.msg_namelen); +if (ret) { + goto out; + } + } + ret = len; + } } } +out:unlock_iovec (vec, target_vec, count, !send);unlock_user_struct (msgp, target_msg, send ?0 :1 );return ret;
Signature · 1 line
1.7.8.6
Quoted 2 lines · Jing Huang
Signed-off-by Jing Huang <[email protected]>
When you send v4 of this series please can you include in this patch the deletion of the comment line
"/* ??? Should this also swap msgh->name? */"
from just above target_to_host_cmsg().
(This patch does the swapping of msgh->name in the caller and so it has dealt with this ??? question.)
If you make just that change you can add
Reviewed-by Peter Maydell <[email protected]>
to the commit message for this patch.
-- PMM