aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/qemu-sockets.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 4026314435..2add83a0fc 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -29,6 +29,9 @@
#ifndef AI_ADDRCONFIG
# define AI_ADDRCONFIG 0
#endif
+#ifndef AI_V4MAPPED
+# define AI_V4MAPPED 0
+#endif
/* used temporarily until all users are converted to QemuOpts */
QemuOptsList socket_optslist = {
@@ -118,7 +121,7 @@ int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp)
int slisten, rc, to, port_min, port_max, p;
memset(&ai,0, sizeof(ai));
- ai.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
+ ai.ai_flags = AI_PASSIVE;
ai.ai_family = PF_UNSPEC;
ai.ai_socktype = SOCK_STREAM;
@@ -335,7 +338,7 @@ static struct addrinfo *inet_parse_connect_opts(QemuOpts *opts, Error **errp)
memset(&ai, 0, sizeof(ai));
- ai.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
+ ai.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ADDRCONFIG;
ai.ai_family = PF_UNSPEC;
ai.ai_socktype = SOCK_STREAM;
@@ -435,7 +438,7 @@ int inet_dgram_opts(QemuOpts *opts, Error **errp)
/* lookup peer addr */
memset(&ai,0, sizeof(ai));
- ai.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
+ ai.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ADDRCONFIG;
ai.ai_family = PF_UNSPEC;
ai.ai_socktype = SOCK_DGRAM;