[glibc] - Correctly identify all 127.x.y.z addresses (#739743) - Don't assign native result if result has

Jeffrey Law law at fedoraproject.org
Fri Feb 17 19:36:09 UTC 2012


commit ecc055dd90636c44aca6dce9f05e60cac2d1aa35
Author: Jeff Law <law at redhat.com>
Date:   Fri Feb 17 12:36:00 2012 -0700

     - Correctly identify all 127.x.y.z addresses (#739743)
     - Don't assign native result if result has no associated interface
    (#739743)

 glibc-rh739743.patch |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++
 glibc.spec           |    9 +++++++-
 2 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/glibc-rh739743.patch b/glibc-rh739743.patch
new file mode 100644
index 0000000..c390b77
--- /dev/null
+++ b/glibc-rh739743.patch
@@ -0,0 +1,55 @@
+2009-04-26  Aurelien Jarno  <aurelien at aurel32.net>
+
+	* sysdeps/posix/getaddrinfo.c (rfc3484_sort): don't assign native
+	result if the result has no associated interface.
+
+---
+ sysdeps/posix/getaddrinfo.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -1456,13 +1456,13 @@
+ 
+ 	      /* 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);
+
+2009-03-15  Aurelien Jarno  <aurelien at aurel32.net>
+
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): correctly detect 
+	interface for all 127.X.Y.Z addresses.
+
+---
+ sysdeps/posix/getaddrinfo.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -2265,7 +2265,14 @@
+ 			  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
+ 			{
diff --git a/glibc.spec b/glibc.spec
index acad7b4..effaadf 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -28,7 +28,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 20%{?dist}
+Release: 21%{?dist}
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -94,6 +94,8 @@ Patch29: %{name}-rh790298.patch
 Patch30: %{name}-rh791161.patch
 # Submitted upstream BZ 12377
 Patch31 : %{name}-rh697149.patch
+# Submitted upstream BZ 9954
+Patch32 : %{name}-rh739743.patch
 
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -344,6 +346,7 @@ rm -rf %{glibcportsdir}
 %patch29 -p1
 %patch30 -p1
 %patch31 -p1
+%patch32 -p1
 
 # A lot of programs still misuse memcpy when they have to use
 # memmove. The memcpy implementation below is not tolerant at
@@ -1196,6 +1199,10 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Fri Feb 17 2012 Jeff Law <law at redhat.com> - 2.15-21
+  - Correctly identify all 127.x.y.z addresses (#739743)
+  - Don't assign native result if result has no associated interface (#739743)
+
 * Fri Feb 17 2012 Jeff Law <law at redhat.com> - 2.15-20
   - Ignore link-local IPV6 addresses for AI_ADDRCONFIG (#697149)
 


More information about the scm-commits mailing list