diff mbox series

linux-user: fix recvmsg emulation

Message ID mvmimxprmn8.fsf@suse.de
State New
Headers show
Series linux-user: fix recvmsg emulation | expand

Commit Message

Andreas Schwab Feb. 12, 2019, 4:34 p.m. UTC
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(+)

Comments

Laurent Vivier Feb. 12, 2019, 5:09 p.m. UTC | #1
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>
Philippe Mathieu-Daudé Feb. 12, 2019, 6:22 p.m. UTC | #2
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);
>
Laurent Vivier Feb. 14, 2019, 9:23 a.m. UTC | #3
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
diff mbox series

Patch

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);