--- a/genericopenlibs/openenvcore/libc/src/net/getaddrinfo.c Wed Sep 01 12:36:54 2010 +0100
+++ b/genericopenlibs/openenvcore/libc/src/net/getaddrinfo.c Wed Sep 15 00:31:55 2010 +0300
@@ -1746,6 +1746,7 @@
struct addrinfo *currNative;
int haveV6asV4 = 0;
int haveV4asV6 = 0;
+ int haverealv4 = 0;
/* Get the list of addresses using the native api */
int ret = getaddrinfo_private(hostname, pai, &resNative);
if (ret != 0)
@@ -1776,6 +1777,7 @@
}
cur = cur->ai_next;
+ haverealv4 = 1;
}
}
@@ -1832,7 +1834,7 @@
if (haveV6asV4)
{
- if ((hints->ai_family == PF_INET && !sentinel.ai_next) || (hints->ai_flags & (AI_V4MAPPED|AI_ALL)))
+ if ((hints->ai_family == PF_INET && !sentinel.ai_next) || (hints->ai_family == PF_UNSPEC && !haverealv4) || (hints->ai_flags & (AI_V4MAPPED|AI_ALL)))
{
currNative = resNative;
while (currNative)