qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Guido Günther" <agx@sigxcpu.org>, "Riku Voipio" <riku.voipio@iki.fi>
Subject: Re: [PATCH v7 4/9] linux-user/syscall: Introduce target_sockaddr_nl
Date: Mon, 21 Oct 2019 11:42:06 +0200	[thread overview]
Message-ID: <f1beaa1c-8cbf-7e22-a612-8881ffaf00b5@vivier.eu> (raw)
In-Reply-To: <20190915213924.22223-5-f4bug@amsat.org>

Le 15/09/2019 à 23:39, Philippe Mathieu-Daudé a écrit :
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Tested-By: Guido Günther <agx@sigxcpu.org>
> ---
> v7: use abi_ushort and abi_uint to keep alignments good (lvivier)
> ---
>  linux-user/syscall.c      | 6 ++++--
>  linux-user/syscall_defs.h | 7 +++++++
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index e2af3c1494..f1ab81b917 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -1496,8 +1496,10 @@ static inline abi_long host_to_target_sockaddr(abi_ulong target_addr,
>          sizeof(target_saddr->sa_family)) {
>          target_saddr->sa_family = tswap16(addr->sa_family);
>      }
> -    if (addr->sa_family == AF_NETLINK && len >= sizeof(struct sockaddr_nl)) {
> -        struct sockaddr_nl *target_nl = (struct sockaddr_nl *)target_saddr;
> +    if (addr->sa_family == AF_NETLINK &&
> +        len >= sizeof(struct target_sockaddr_nl)) {
> +        struct target_sockaddr_nl *target_nl =
> +               (struct target_sockaddr_nl *)target_saddr;
>          target_nl->nl_pid = tswap32(target_nl->nl_pid);
>          target_nl->nl_groups = tswap32(target_nl->nl_groups);
>      } else if (addr->sa_family == AF_PACKET) {
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index fa69c6ab8d..7694d72446 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -153,6 +153,13 @@ struct target_sockaddr_un {
>      uint8_t sun_path[108];
>  };
>  
> +struct target_sockaddr_nl {
> +    abi_ushort nl_family;   /* AF_NETLINK */
> +    abi_ushort __pad;
> +    abi_uint nl_pid;
> +    abi_uint nl_groups;
> +};
> +
>  struct target_in_addr {
>      uint32_t s_addr; /* big endian */
>  };
> 

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


  reply	other threads:[~2019-10-21  9:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-15 21:39 [Qemu-devel] [PATCH v7 0/9] linux-user: strace improvements Philippe Mathieu-Daudé
2019-09-15 21:39 ` [Qemu-devel] [PATCH v7 3/9] linux-user/strace: Improve settimeofday() Philippe Mathieu-Daudé
2019-09-15 21:39 ` [Qemu-devel] [PATCH v7 4/9] linux-user/syscall: Introduce target_sockaddr_nl Philippe Mathieu-Daudé
2019-10-21  9:42   ` Laurent Vivier [this message]
2019-09-15 21:39 ` [Qemu-devel] [PATCH v7 6/9] linux-user/strace: Add print_sockfd() Philippe Mathieu-Daudé
2019-10-21  9:51   ` Laurent Vivier
2019-09-15 21:39 ` [Qemu-devel] [PATCH v7 8/9] linux-user/strace: Let print_sockaddr() have a 'last' argument Philippe Mathieu-Daudé
2019-10-21  9:56   ` Laurent Vivier
2019-09-15 21:39 ` [Qemu-devel] [RFC PATCH v7 9/9] linux-user/syscall: Align target_sockaddr fields using ABI types Philippe Mathieu-Daudé
2019-10-21  9:59   ` Laurent Vivier
2019-09-30 15:44 ` [PATCH v7 0/9] linux-user: strace improvements Philippe Mathieu-Daudé
2019-10-17 12:48   ` Philippe Mathieu-Daudé
     [not found] ` <20190915213924.22223-2-f4bug@amsat.org>
2019-10-21  9:38   ` [PATCH v7 1/9] linux-user/strace: Display invalid pointer in print_timeval() Laurent Vivier
     [not found] ` <20190915213924.22223-3-f4bug@amsat.org>
2019-10-21  9:40   ` [PATCH v7 2/9] linux-user/strace: Add print_timezone() Laurent Vivier
     [not found] ` <20190915213924.22223-6-f4bug@amsat.org>
2019-10-21  9:48   ` [PATCH v7 5/9] linux-user/strace: Dump AF_NETLINK sockaddr content Laurent Vivier
     [not found] ` <20190915213924.22223-8-f4bug@amsat.org>
2019-10-21  9:53   ` [PATCH v7 7/9] linux-user/strace: Improve bind() output Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1beaa1c-8cbf-7e22-a612-8881ffaf00b5@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=agx@sigxcpu.org \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).