# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1284499915 -10800 # Node ID 82ca0c6a68ed953fedb8cc49c8280906d5ab93a8 # Parent 2efc27d87e1cf61739085914a7d1cbb8065fea4c Revision: 201021 Kit: 201035 diff -r 2efc27d87e1c -r 82ca0c6a68ed genericopenlibs/openenvcore/libc/src/net/getaddrinfo.c --- 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)