qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v1] util: don't use AI_V4MAPPED flag to getaddrinfo on FreeBSD
Date: Thu, 31 Mar 2016 14:06:50 +0100	[thread overview]
Message-ID: <1459429610-5762-1-git-send-email-berrange@redhat.com> (raw)

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 <berrange@redhat.com>
---
 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

                 reply	other threads:[~2016-03-31 13:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459429610-5762-1-git-send-email-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).