mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
build: avoid non-portable IPv6 struct member, for MacOS X
* src/util/network.c (getIPv6Addr): Manually join s6_addr bytes, instead of assuming s6_addr16 shorts. Reported by Justin Clifton; solution suggested by Bruno Haible.
This commit is contained in:
parent
58ba49ac70
commit
8ae354f41b
@ -47,7 +47,8 @@ static int getIPv6Addr(virSocketAddrPtr addr, virIPv6AddrPtr tab) {
|
||||
return(-1);
|
||||
|
||||
for (i = 0;i < 8;i++) {
|
||||
(*tab)[i] = ntohs(addr->inet6.sin6_addr.s6_addr16[i]);
|
||||
(*tab)[i] = ((addr->inet6.sin6_addr.s6_addr[2 * i] << 8) |
|
||||
addr->inet6.sin6_addr.s6_addr[2 * i + 1]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
|
Loading…
Reference in New Issue
Block a user