Author: aurel32
Date: 2012-10-09 06:17:15 +0000 (Tue, 09 Oct 2012)
New Revision: 5319

Added:
   
glibc-package/trunk/debian/patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
  * patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff: new patch to
    fix getaddrinfo() when service = 0 on a FreeBSD kernel with DNS
    server returning IPv6, but without IPv6 connection.  Closes: #690021.



Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog        2012-09-23 20:35:09 UTC (rev 
5318)
+++ glibc-package/trunk/debian/changelog        2012-10-09 06:17:15 UTC (rev 
5319)
@@ -4,6 +4,9 @@
   * patches/any/cvs-strtod-overflow.diff: new patch from upstream to fix
     an integer/buffer overflow in strtod() (CVE-2012-3480).  Closes: 
     #684889.
+  * patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff: new patch to
+    fix getaddrinfo() when service = 0 on a FreeBSD kernel with DNS
+    server returning IPv6, but without IPv6 connection.  Closes: #690021.
 
   [ Samuel Thibault ]
   * libc0.3.symbols.hurd-i386: Add missing *_exec_file_name symbols.

Added: 
glibc-package/trunk/debian/patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff
===================================================================
--- 
glibc-package/trunk/debian/patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff
                           (rev 0)
+++ 
glibc-package/trunk/debian/patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff
   2012-10-09 06:17:15 UTC (rev 5319)
@@ -0,0 +1,19 @@
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -2267,8 +2267,15 @@
+               }
+ 
+             socklen_t sl = sizeof (results[i].source_addr);
++            struct sockaddr sa = *q->ai_addr;
++#ifdef __FreeBSD_kernel__
++            /* The FreeBSD kernel doesn't allow connections on port 0. Use
++               port 1 instead, as on the FreeBSD libc. */
++            if (((struct sockaddr_in *)&sa)->sin_port == htons(0))
++              ((struct sockaddr_in *)&sa)->sin_port = htons(1);
++#endif
+             if (fd != -1
+-                && __connect (fd, q->ai_addr, q->ai_addrlen) == 0
++                && __connect (fd, &sa, q->ai_addrlen) == 0
+                 && __getsockname (fd,
+                                   (struct sockaddr *) &results[i].source_addr,
+                                   &sl) == 0)

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series   2012-09-23 20:35:09 UTC (rev 
5318)
+++ glibc-package/trunk/debian/patches/series   2012-10-09 06:17:15 UTC (rev 
5319)
@@ -210,6 +210,7 @@
 hurd-i386/unsubmitted-gnumach.defs.diff
 
 kfreebsd/submitted-libc_once.diff
+kfreebsd/local-getaddrinfo-freebsd-kernel.diff
 
 ia64/local-dlfptr.diff
 ia64/submitted-sysconf.diff


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to