about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-11-09 20:30:06 +0000
committerUlrich Drepper <drepper@redhat.com>2006-11-09 20:30:06 +0000
commit1c632cebfa24f661f77e0e51d360b53d631e59b4 (patch)
tree35cd3ab9eca86ce46d100223e5318ed3c44bd3f1
parent2f334ad5c3c1510f5dc6b0a1ecebba2168effba7 (diff)
downloadglibc-1c632cebfa24f661f77e0e51d360b53d631e59b4.tar.gz
glibc-1c632cebfa24f661f77e0e51d360b53d631e59b4.tar.xz
glibc-1c632cebfa24f661f77e0e51d360b53d631e59b4.zip
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Fix test for cvs/fedora-glibc-20061109T2048
	temporary or deprecated addresses.
	Patch by Sridhar Samudrala <sri@us.ibm.com>.
-rw-r--r--ChangeLog4
-rw-r--r--sysdeps/posix/getaddrinfo.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7932258837..414a175c5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-11-09  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Fix test for
+	temporary or deprecated addresses.
+	Patch by Sridhar Samudrala <sri@us.ibm.com>.
+
 	* string/Makefile (tests): Add tst-strxfrm2.
 	* string/tst-strxfrm2.c: New file.
 
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 84a6293365..b4966852a7 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2085,10 +2085,12 @@ getaddrinfo (const char *name, const char *service,
 
 		  if (q->ai_family == PF_INET6 && in6ai != NULL)
 		    {
-		      /* See whether the address is the list of deprecated
-			 or temporary addresses.  */
+		      /* See whether the source address is the list of
+			 deprecated or temporary addresses.  */
 		      struct in6addrinfo tmp;
-		      memcpy (tmp.addr, q->ai_addr, IN6ADDRSZ);
+		      struct sockaddr_in6 *sin6p
+			= (struct sockaddr_in6 *) &results[i].source_addr;
+		      memcpy (tmp.addr, &sin6p->sin6_addr, IN6ADDRSZ);
 
 		      struct in6addrinfo *found
 			= bsearch (&tmp, in6ai, in6ailen, sizeof (*in6ai),