mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
virNetSocketCheckProtocols: Actually check bool value
In9536379da4
and8b0cb0e666
I've tried to call virNetSocketCheckProtocolByLookup() only if we are suspecting the host is IPv4 or IPv6 capable (because we've found an interface with such address). However, the code was missing dereference of the boolean variables and thus was comparing pointers against NULL. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7d488a7c45
commit
0dcf9562e2
@ -205,11 +205,11 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
|
||||
|
||||
freeifaddrs(ifaddr);
|
||||
|
||||
if (hasIPv4 &&
|
||||
if (*hasIPv4 &&
|
||||
virNetSocketCheckProtocolByLookup("127.0.0.1", AF_INET, hasIPv4) < 0)
|
||||
return -1;
|
||||
|
||||
if (hasIPv6 &&
|
||||
if (*hasIPv6 &&
|
||||
virNetSocketCheckProtocolByLookup("::1", AF_INET6, hasIPv6) < 0)
|
||||
return -1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user