linux-user: convert sockaddr_ll from host to target
commita82ea9393df18276f36e3202d2cc3ad73b980e92
authorLaurent Vivier <laurent@vivier.eu>
Sun, 26 Jun 2016 22:18:22 +0000 (27 00:18 +0200)
committerRiku Voipio <riku.voipio@linaro.org>
Tue, 19 Jul 2016 12:20:59 +0000 (19 15:20 +0300)
tree646bd2f548ad906af3a4ead396265925f8f44b32
parentc35e1f9c87ca57b126cec1bdd56298f63939c420
linux-user: convert sockaddr_ll from host to target

As we convert sockaddr for AF_PACKET family for sendto() (target to
host) we need also to convert this for getsockname() (host to target).

arping uses getsockname() to get the the interface address and uses
this address with sendto().

Tested with:

    /sbin/arping -D -q -c2 -I eno1 192.168.122.88

...
getsockname(3, {sa_family=AF_PACKET, proto=0x806, if2,
pkttype=PACKET_HOST, addr(6)={1, 10c37b6b9a76}, [18]) = 0
...
sendto(3, "..." 28, 0,
       {sa_family=AF_PACKET, proto=0x806, if2, pkttype=PACKET_HOST,
       addr(6)={1, ffffffffffff}, 20) = 28
...

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c