Le 15/02/2018 à 16:28, Philippe Mathieu-Daudé a écrit : > Hi Laurent, > > On 02/15/2018 12:17 PM, Laurent Vivier wrote: >> Le 24/01/2018 à 14:01, Philippe Mathieu-Daudé a écrit : >>> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> >>> --- >>> please double check __pad and ntohl() >>> >>> linux-user/syscall_defs.h | 7 +++++++ >>> linux-user/strace.c | 34 ++++++++++++++++++++++++++++++++++ >>> 2 files changed, 41 insertions(+) >>> >>> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h >>> index bec3680b94..550e7d2939 100644 >>> --- a/linux-user/syscall_defs.h >>> +++ b/linux-user/syscall_defs.h >>> @@ -151,6 +151,13 @@ struct target_sockaddr_un { >>> uint8_t sun_path[108]; >>> }; >>> >>> +struct target_sockaddr_nl { >>> + uint16_t nl_family; /* AF_NETLINK */ >>> + int16_t __pad; >> >> netlink.h uses an unsigned type here. > > This is padding, do you prefer char pad[2]?
kernel has: struct sockaddr_nl { __kernel_sa_family_t nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* zero */ __u32 nl_pid; /* port ID */ __u32 nl_groups; /* multicast groups mask */ }; so I prefer "uint16_t", but as you say, it is padding, so sign is meaningless, if you prefer you can keep int16_t. Now, it would be good to use target_sockaddr_nl in host_to_target_sockaddr() as we define it. Thanks, Laurent