aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index dcf13238e5..7163ade3f3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1140,6 +1140,13 @@ static inline abi_long target_to_host_sockaddr(struct sockaddr *addr,
memcpy(addr, target_saddr, len);
addr->sa_family = sa_family;
+ if (sa_family == AF_PACKET) {
+ struct target_sockaddr_ll *lladdr;
+
+ lladdr = (struct target_sockaddr_ll *)addr;
+ lladdr->sll_ifindex = tswap32(lladdr->sll_ifindex);
+ lladdr->sll_hatype = tswap16(lladdr->sll_hatype);
+ }
unlock_user(target_saddr, target_addr, 0);
return 0;