mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00: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. (cherry picked from commit fbb27088eec1b54fcd5a0950b11c31d27a2598d4)
This commit is contained in:
parent
58211ca54d
commit
85cf1ad5aa
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user