qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/4] linux-user: fix sockaddr_in6 endianness


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 2/4] linux-user: fix sockaddr_in6 endianness
Date: Mon, 20 Feb 2023 10:06:41 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 20/2/23 09:58, Mathis Marion wrote:
From: Mathis Marion <mathis.marion@silabs.com>

Fields sin6_flowinfo and sin6_scope_id use the host byte order, so there
is a conversion to be made when host and target endianness differ.

Signed-off-by: Mathis Marion <mathis.marion@silabs.com>
---
  linux-user/syscall.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 58549de125..1a6856abec 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1713,6 +1713,12 @@ static inline abi_long target_to_host_sockaddr(int fd, 
struct sockaddr *addr,
        lladdr = (struct target_sockaddr_ll *)addr;
        lladdr->sll_ifindex = tswap32(lladdr->sll_ifindex);
        lladdr->sll_hatype = tswap16(lladdr->sll_hatype);
+    } else if (sa_family == AF_INET6) {
+        struct sockaddr_in6 *in6addr;
+
+        in6addr = (struct sockaddr_in6 *)addr;
+        in6addr->sin6_flowinfo = tswap32(in6addr->sin6_flowinfo);
+        in6addr->sin6_scope_id = tswap32(in6addr->sin6_scope_id);
      }
      unlock_user(target_saddr, target_addr, 0);

Same content as v1, right?

If you don't change patch content, please include the reviewer tags
so we don't have to review your patches again.

So similarly to
6be6bf58-cf92-7068-008e-83f5543a1f01@linaro.org/">https://lore.kernel.org/qemu-devel/6be6bf58-cf92-7068-008e-83f5543a1f01@linaro.org/
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]