[Qemu-devel] [PATCH] linux-user: fix recvmsg emulation

Andreas Schwab posted 1 patch 6 years, 8 months ago
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Test asan passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/mvmimxprmn8.fsf@suse.de
Maintainers: Laurent Vivier <laurent@vivier.eu>, Riku Voipio <riku.voipio@iki.fi>
linux-user/syscall.c | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH] linux-user: fix recvmsg emulation
Posted by Andreas Schwab 6 years, 8 months ago
Set msg_flags in the returned struct msghdr.

Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 90bfda3563..b6b566a6fa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
             }
             if (!is_error(ret)) {
                 msgp->msg_namelen = tswap32(msg.msg_namelen);
+                msgp->msg_flags = tswap32(msg.msg_flags);
                 if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
                     ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
                                     msg.msg_name, msg.msg_namelen);
-- 
2.20.1


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Re: [Qemu-devel] [PATCH] linux-user: fix recvmsg emulation
Posted by Laurent Vivier 6 years, 8 months ago
On 12/02/2019 17:34, Andreas Schwab wrote:
> Set msg_flags in the returned struct msghdr.
> 
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>  linux-user/syscall.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 90bfda3563..b6b566a6fa 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
>              }
>              if (!is_error(ret)) {
>                  msgp->msg_namelen = tswap32(msg.msg_namelen);
> +                msgp->msg_flags = tswap32(msg.msg_flags);
>                  if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
>                      ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
>                                      msg.msg_name, msg.msg_namelen);
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


Re: [Qemu-devel] [PATCH] linux-user: fix recvmsg emulation
Posted by Philippe Mathieu-Daudé 6 years, 8 months ago
On 2/12/19 5:34 PM, Andreas Schwab wrote:
> Set msg_flags in the returned struct msghdr.
> 
> Signed-off-by: Andreas Schwab <schwab@suse.de>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  linux-user/syscall.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 90bfda3563..b6b566a6fa 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
>              }
>              if (!is_error(ret)) {
>                  msgp->msg_namelen = tswap32(msg.msg_namelen);
> +                msgp->msg_flags = tswap32(msg.msg_flags);
>                  if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
>                      ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
>                                      msg.msg_name, msg.msg_namelen);
> 

Re: [Qemu-devel] [PATCH] linux-user: fix recvmsg emulation
Posted by Laurent Vivier 6 years, 8 months ago
On 12/02/2019 17:34, Andreas Schwab wrote:
> Set msg_flags in the returned struct msghdr.
> 
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>  linux-user/syscall.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 90bfda3563..b6b566a6fa 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
>              }
>              if (!is_error(ret)) {
>                  msgp->msg_namelen = tswap32(msg.msg_namelen);
> +                msgp->msg_flags = tswap32(msg.msg_flags);
>                  if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
>                      ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
>                                      msg.msg_name, msg.msg_namelen);
> 

Applied to my linux-user branch.

Thanks,
Laurent