Author: aurel32
Date: 2009-03-15 14:47:39 +0000 (Sun, 15 Mar 2009)
New Revision: 3378

Added:
   glibc-package/trunk/debian/patches/any/submitted-getaddrinfo-lo.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
  * any/submitted-getaddrinfo-lo.diff: correctly handle the lo interface and
    associated addresses when checking for native connection.  Closes: 
    bug#519545.



Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog        2009-03-15 09:50:58 UTC (rev 
3377)
+++ glibc-package/trunk/debian/changelog        2009-03-15 14:47:39 UTC (rev 
3378)
@@ -12,6 +12,9 @@
     only returning a broken AAAA answer. As it seems the second type of broken
     DNS concerns more users, let's revert to the old behaviour.  Closes: 
     #516218.
+  * any/submitted-getaddrinfo-lo.diff: correctly handle the lo interface and
+    associated addresses when checking for native connection.  Closes: 
+    bug#519545.
 
  -- Aurelien Jarno <aure...@debian.org>  Sun, 15 Mar 2009 10:29:05 +0100
 

Added: glibc-package/trunk/debian/patches/any/submitted-getaddrinfo-lo.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/submitted-getaddrinfo-lo.diff        
                        (rev 0)
+++ glibc-package/trunk/debian/patches/any/submitted-getaddrinfo-lo.diff        
2009-03-15 14:47:39 UTC (rev 3378)
@@ -0,0 +1,41 @@
+2009-03-15  Aurelien Jarno  <aurel...@aurel32.net>
+
+       * sysdeps/posix/getaddrinfo.c (rfc3484_sort): don't assigned native
+       result if the result has no associated interface.
+       * sysdeps/posix/getaddrinfo.c (getaddrinfo): correctly detect 
+       interface for all 127.X.Y.Z addresses.
+
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -1455,13 +1455,13 @@ rfc3484_sort (const void *p1, const void *p2, void 
*arg)
+ 
+             /* Fill in the results in all the records.  */
+             for (int i = 0; i < src->nresults; ++i)
+-              if (src->results[i].index == a1_index)
++              if (a1_index != -1 && src->results[i].index == a1_index)
+                 {
+                   assert (src->results[i].native == -1
+                           || src->results[i].native == a1_native);
+                   src->results[i].native = a1_native;
+                 }
+-              else if (src->results[i].index == a2_index)
++              else if (a2_index != -1 && src->results[i].index == a2_index)
+                 {
+                   assert (src->results[i].native == -1
+                           || src->results[i].native == a2_native);
+@@ -2264,7 +2264,14 @@ getaddrinfo (const char *name, const char *service,
+                         tmp.addr[0] = 0;
+                         tmp.addr[1] = 0;
+                         tmp.addr[2] = htonl (0xffff);
+-                        tmp.addr[3] = sinp->sin_addr.s_addr;
++                        /* Special case for lo interface, the source address
++                           being possibly different than the interface 
++                           address. */
++                        if ((ntohl(sinp->sin_addr.s_addr) & 0xff000000)
++                            == 0x7f000000)
++                          tmp.addr[3] = htonl(0x7f000001);
++                        else
++                          tmp.addr[3] = sinp->sin_addr.s_addr;
+                       }
+                     else
+                       {

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series   2009-03-15 09:50:58 UTC (rev 
3377)
+++ glibc-package/trunk/debian/patches/series   2009-03-15 14:47:39 UTC (rev 
3378)
@@ -192,3 +192,4 @@
 any/submitted-futex_robust_pi.diff
 any/cvs-bz7058-nss_nss-nis.diff
 any/local-disable-gethostbyname4.diff
+any/submitted-getaddrinfo-lo.diff


-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to