On 12 July 2014 10:46, Joakim Tjernlund <joakim.tjernl...@transmode.se> wrote: > Used by AF_PACKET sockets > --- > linux-user/syscall.c | 7 +++++++ > linux-user/syscall_defs.h | 10 ++++++++++ > 2 files changed, 17 insertions(+) > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 5a07d9c..a87fe74 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);
Your indentation here and in the struct definition below looks wrong -- should be four-spaces. Otherwise Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> PS: your commit message is a little terse. I would suggest: === linux-user: handle AF_PACKET sockaddrs in target_to_host_sockaddr Implement conversion of the AF_PACKET sockaddr subtype in target_to_host_sockaddr. === thanks -- PMM