mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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.
This commit is contained in:
parent
bfaaa2b681
commit
fbb27088ee
@ -183,7 +183,8 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
|
|||||||
|
|
||||||
if ((gaierr = getaddrinfo("::1", NULL, &hints, &ai)) != 0) {
|
if ((gaierr = getaddrinfo("::1", NULL, &hints, &ai)) != 0) {
|
||||||
if (gaierr == EAI_ADDRFAMILY ||
|
if (gaierr == EAI_ADDRFAMILY ||
|
||||||
gaierr == EAI_FAMILY) {
|
gaierr == EAI_FAMILY ||
|
||||||
|
gaierr == EAI_NONAME) {
|
||||||
*hasIPv6 = false;
|
*hasIPv6 = false;
|
||||||
} else {
|
} else {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
Loading…
Reference in New Issue
Block a user