From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alcJT-0002VO-Ta for qemu-devel@nongnu.org; Thu, 31 Mar 2016 09:07:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alcJO-0007WU-Vd for qemu-devel@nongnu.org; Thu, 31 Mar 2016 09:07:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alcJO-0007WN-Id for qemu-devel@nongnu.org; Thu, 31 Mar 2016 09:06:58 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3F33846202 for ; Thu, 31 Mar 2016 13:06:58 +0000 (UTC) From: "Daniel P. Berrange" Date: Thu, 31 Mar 2016 14:06:50 +0100 Message-Id: <1459429610-5762-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PATCH v1] util: don't use AI_V4MAPPED flag to getaddrinfo on FreeBSD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Gerd Hoffmann The FreeBSD header files define the AI_V4MAPPED but its implementation of getaddrinfo() always returns an error when that flag is set. eg address resolution failed for localhost:9000: Invalid value for ai_flags Since this flag is not critical for DNS lookups, just undefine it on FreeBSD platforms. Signed-off-by: Daniel P. Berrange --- util/qemu-sockets.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index b87e17f..3007345 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -29,6 +29,15 @@ #ifndef AI_ADDRCONFIG # define AI_ADDRCONFIG 0 #endif + +/* FreeBSD defines AI_V4MAPPED in its header files but its + * getaddrinfo() implementation always returns an error + * when it is used. Tested with FreeBSD 10.2. Recheck new + * releases periodically to see if this gets fixed.... + */ +#if defined(AI_V4MAPPED) && defined(__FreeBSD__) +# undef AI_V4MAPPED +#endif #ifndef AI_V4MAPPED # define AI_V4MAPPED 0 #endif -- 2.5.5