src: conditionalize EAI_ADDRFAMILY

The EAI_ADDRFAMILY constant has been removed from FreeBSD
headers, supposedly because it is deprecated by new RFC
drafts.

Previously GNULIB was providing a replacement because
MinGW lacked it too. The replacement provided for MinGW
was thus being used on FreeBSD too, but with a completely
bogus integer value.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-01-23 11:40:39 +00:00
parent 21fa70e2f6
commit e429934550

View File

@ -178,8 +178,10 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
hints.ai_socktype = SOCK_STREAM;
if ((gaierr = getaddrinfo("::1", NULL, &hints, &ai)) != 0) {
if (gaierr == EAI_ADDRFAMILY ||
gaierr == EAI_FAMILY ||
if (gaierr == EAI_FAMILY ||
# ifdef EAI_ADDRFAMILY
gaierr == EAI_ADDRFAMILY ||
# endif
gaierr == EAI_NONAME) {
*hasIPv6 = false;
} else {