From e429934550be5417a1576efce6d94ec032f1ecee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 23 Jan 2020 11:40:39 +0000 Subject: [PATCH] src: conditionalize EAI_ADDRFAMILY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Daniel P. Berrangé --- 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 { -- GitLab