]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 1 Oct 1999 21:42:39 +0000 (21:42 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 1 Oct 1999 21:42:39 +0000 (21:42 +0000)
1999-10-01  Ulrich Drepper  <drepper@cygnus.com>

* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr_r): Align
handling of IPv6 tunnel address handling with bind 8.2.1.  Allow
len argument to be greater than needed address size.

ChangeLog
resolv/nss_dns/dns-host.c

index 5aa6ce80f6ffb6947e3f099a0a5b03c7bd64151d..2ef7e9af1425360f3d46a8277b0402e671db51b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-10-01  Ulrich Drepper  <drepper@cygnus.com>
+
+       * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr_r): Align
+       handling of IPv6 tunnel address handling with bind 8.2.1.  Allow
+       len argument to be greater than needed address size.
+
 1999-10-01  Andreas Jaeger  <aj@suse.de>
 
        * locale/programs/ld-collate.c (insert_value): Add cast to avoid
index c075961e91f65526baa80461e742bd6aa610f89a..482cbd3ab4be4b30a18ca3cdd56a8d13978f36c1 100644 (file)
@@ -197,6 +197,7 @@ _nss_dns_gethostbyaddr_r (const char *addr, size_t len, int af,
 {
   static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
   static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+  static const u_char v6local[] = { 0,0, 0,1 };
   const u_char *uaddr = (const u_char *)addr;
   struct host_data
   {
@@ -210,9 +211,10 @@ _nss_dns_gethostbyaddr_r (const char *addr, size_t len, int af,
   size_t size;
   int n, status;
 
-  if (af == AF_INET6 && len == IN6ADDRSZ &&
-      (memcmp (uaddr, mapped, sizeof mapped) == 0
-       || memcmp (uaddr, tunnelled, sizeof tunnelled) == 0))
+  if (af == AF_INET6 && len == IN6ADDRSZ
+      && (memcmp (uaddr, mapped, sizeof mapped) == 0
+         || (memcmp (uaddr, tunnelled, sizeof tunnelled) == 0
+             && memcmp (&uaddr[sizeof tunnelled], v6local, sizeof v6local))))
     {
       /* Unmap. */
       addr += sizeof mapped;
@@ -234,7 +236,7 @@ _nss_dns_gethostbyaddr_r (const char *addr, size_t len, int af,
       *h_errnop = NETDB_INTERNAL;
       return NSS_STATUS_UNAVAIL;
     }
-  if (size != len)
+  if (size > len)
     {
       *errnop = EAFNOSUPPORT;
       *h_errnop = NETDB_INTERNAL;