Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 00:31:55 +0300
branchRCL_3
changeset 60 82ca0c6a68ed
parent 57 2efc27d87e1c
child 61 b670675990af
child 64 c44f36bb61a3
Revision: 201021 Kit: 201035
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)