[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/28] linux-user: fix sockaddr_in6 endianness
From: |
Laurent Vivier |
Subject: |
[PULL 10/28] linux-user: fix sockaddr_in6 endianness |
Date: |
Fri, 10 Mar 2023 23:09:09 +0100 |
From: Mathis Marion <mathis.marion@silabs.com>
The sin6_scope_id field uses 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>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230307154256.101528-2-Mathis.Marion@silabs.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 931f9db47552..05c81079e745 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1714,6 +1714,11 @@ 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_scope_id = tswap32(in6addr->sin6_scope_id);
}
unlock_user(target_saddr, target_addr, 0);
--
2.39.2
- [PULL 17/28] linux-user/sparc: Tidy window spill/fill traps, (continued)
- [PULL 17/28] linux-user/sparc: Tidy window spill/fill traps, Laurent Vivier, 2023/03/10
- [PULL 18/28] linux-user/sparc: Fix sparc64_{get, set}_context traps, Laurent Vivier, 2023/03/10
- [PULL 22/28] linux-user/sparc: Handle priviledged opcode trap, Laurent Vivier, 2023/03/10
- [PULL 11/28] linux-user: handle netlink flag NLA_F_NESTED, Laurent Vivier, 2023/03/10
- [PULL 23/28] linux-user/sparc: Handle privilidged action trap, Laurent Vivier, 2023/03/10
- [PULL 24/28] linux-user/sparc: Handle coprocessor disabled trap, Laurent Vivier, 2023/03/10
- [PULL 19/28] linux-user/sparc: Handle software breakpoint trap, Laurent Vivier, 2023/03/10
- [PULL 09/28] linux-user: Add strace for prlimit64() syscall, Laurent Vivier, 2023/03/10
- [PULL 16/28] linux-user/sparc: Use TT_TRAP for flush windows, Laurent Vivier, 2023/03/10
- [PULL 21/28] linux-user/sparc: Handle getcc, setcc, getpsr traps, Laurent Vivier, 2023/03/10
- [PULL 10/28] linux-user: fix sockaddr_in6 endianness,
Laurent Vivier <=
- [PULL 26/28] linux-user/sparc: Handle floating-point exceptions, Laurent Vivier, 2023/03/10
- [PULL 25/28] linux-user/sparc: Handle unimplemented flush trap, Laurent Vivier, 2023/03/10
- [PULL 27/28] linux-user/sparc: Handle tag overflow traps, Laurent Vivier, 2023/03/10
- [PULL 28/28] linux-user: fix bug about incorrect base addresss of gdt on i386 and x86_64, Laurent Vivier, 2023/03/10
- Re: [PULL 00/28] Linux user for 8.0 patches, Peter Maydell, 2023/03/12