mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00:00
linux-user: handle AF_PACKET sockaddrs in target_to_host_sockaddr
Implement conversion of the AF_PACKET sockaddr subtype in target_to_host_sockaddr. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
committed by
Riku Voipio
parent
451aaf688c
commit
33a29b51c9
@ -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;
|
||||
|
Reference in New Issue
Block a user