Merge Bug 2603 and Bug 3123 plus move exports to rom/bld.inf RCL_3 PDK_3.0.3
authorandy simpson <andrews@symbian.org>
Fri, 17 Sep 2010 17:50:04 +0100
branchRCL_3
changeset 61 b670675990af
parent 60 82ca0c6a68ed (diff)
parent 58 104bd6aeae10 (current diff)
child 76 c9f2a8896598
Merge Bug 2603 and Bug 3123 plus move exports to rom/bld.inf
--- a/genericopenlibs/openenvcore/libc/src/net/getaddrinfo.c	Thu Sep 02 17:14:31 2010 +0100
+++ b/genericopenlibs/openenvcore/libc/src/net/getaddrinfo.c	Fri Sep 17 17:50:04 2010 +0100
@@ -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)