[PATCH 2/3] virNetSocketCheckProtocols: lookup IPv6 only if suspecting IPv6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/rpc/virnetsocket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index b6bc3edc3b..b0d63f0f2c 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -205,7 +205,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);
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux