mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
Replace use of 'in_addr_t' with 'struct in_addr'
The 'in_addr_t' typedef is not present in Mingw64 headers. Instead we can use the more portable 'struct in_addr' and then access its 's_addr' field. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
027a7707be
commit
1a3eaa80a4
@ -235,10 +235,10 @@ virSocketAddrIsPrivate(const virSocketAddrPtr addr)
|
||||
bool
|
||||
virSocketAddrIsWildcard(const virSocketAddrPtr addr)
|
||||
{
|
||||
in_addr_t tmp = INADDR_ANY;
|
||||
struct in_addr tmp = { .s_addr = INADDR_ANY };
|
||||
switch (addr->data.stor.ss_family) {
|
||||
case AF_INET:
|
||||
return memcmp(&addr->data.inet4.sin_addr.s_addr, &tmp,
|
||||
return memcmp(&addr->data.inet4.sin_addr.s_addr, &tmp.s_addr,
|
||||
sizeof(addr->data.inet4.sin_addr.s_addr)) == 0;
|
||||
case AF_INET6:
|
||||
return IN6_IS_ADDR_UNSPECIFIED(&addr->data.inet6.sin6_addr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user