mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
virNetSocketCheckProtocols: lookup IPv6 only if suspecting IPv6
There is not much sense trying to disprove host is IPv6 capable if we know after first round (getifaddrs()) that is is not. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e146f4beef
commit
9536379da4
@ -206,7 +206,8 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
|
||||
freeifaddrs(ifaddr);
|
||||
|
||||
|
||||
if (virNetSocketCheckProtocolByLookup("::1", AF_INET6, hasIPv6) < 0)
|
||||
if (hasIPv6 &&
|
||||
virNetSocketCheckProtocolByLookup("::1", AF_INET6, hasIPv6) < 0)
|
||||
return -1;
|
||||
|
||||
VIR_DEBUG("Protocols: v4 %d v6 %d", *hasIPv4, *hasIPv6);
|
||||
|
Loading…
Reference in New Issue
Block a user