From: Guido Günther Date: Tue, 11 Aug 2015 09:49:18 +0000 (+0200) Subject: virNetSocketCheckProtocols: handle EAI_NONAME as IPv6 unavailable X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fbb27088eec1b54fcd5a0950b11c31d27a2598d4;p=libvirt.git virNetSocketCheckProtocols: handle EAI_NONAME as IPv6 unavailable When running the test suite using "unshare -n" we might have IPv6 but no configured addresses. Due to AI_ADDRCONFIG getaddrinfo then fails with EAI_NONAME which we should then treat as IPv6 unavailable. --- diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 106d09aaf9..5e5f1ab25e 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -183,7 +183,8 @@ int virNetSocketCheckProtocols(bool *hasIPv4, if ((gaierr = getaddrinfo("::1", NULL, &hints, &ai)) != 0) { if (gaierr == EAI_ADDRFAMILY || - gaierr == EAI_FAMILY) { + gaierr == EAI_FAMILY || + gaierr == EAI_NONAME) { *hasIPv6 = false; } else { virReportError(VIR_ERR_INTERNAL_ERROR,