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.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/rpc/virnetsocket.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index b0af7d4dfa..be9ac9aeed 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -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 {
--
2.24.1