- Correctly identify all 127.x.y.z addresses (#739743)

- Don't assign native result if result has no associated interface
(#739743)
This commit is contained in:
Jeff Law 2012-02-17 12:36:00 -07:00
parent 0e9bf8be6a
commit ecc055dd90
2 changed files with 63 additions and 1 deletions

55
glibc-rh739743.patch Normal file
View File

@ -0,0 +1,55 @@
2009-04-26 Aurelien Jarno <aurelien@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@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
{

View File

@ -28,7 +28,7 @@
Summary: The GNU libc libraries Summary: The GNU libc libraries
Name: glibc Name: glibc
Version: %{glibcversion} Version: %{glibcversion}
Release: 20%{?dist} Release: 21%{?dist}
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries. # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs # Things that are linked directly into dynamically linked programs
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional # 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 Patch30: %{name}-rh791161.patch
# Submitted upstream BZ 12377 # Submitted upstream BZ 12377
Patch31 : %{name}-rh697149.patch Patch31 : %{name}-rh697149.patch
# Submitted upstream BZ 9954
Patch32 : %{name}-rh739743.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -344,6 +346,7 @@ rm -rf %{glibcportsdir}
%patch29 -p1 %patch29 -p1
%patch30 -p1 %patch30 -p1
%patch31 -p1 %patch31 -p1
%patch32 -p1
# A lot of programs still misuse memcpy when they have to use # A lot of programs still misuse memcpy when they have to use
# memmove. The memcpy implementation below is not tolerant at # memmove. The memcpy implementation below is not tolerant at
@ -1196,6 +1199,10 @@ rm -f *.filelist*
%endif %endif
%changelog %changelog
* Fri Feb 17 2012 Jeff Law <law@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@redhat.com> - 2.15-20 * Fri Feb 17 2012 Jeff Law <law@redhat.com> - 2.15-20
- Ignore link-local IPV6 addresses for AI_ADDRCONFIG (#697149) - Ignore link-local IPV6 addresses for AI_ADDRCONFIG (#697149)