]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 28 Jul 1999 03:27:45 +0000 (03:27 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 28 Jul 1999 03:27:45 +0000 (03:27 +0000)
1999-07-27  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/posix/getaddrinfo.c (gaih_inet): Only return information
for the hinted protocol.

* sysdeps/unix/sysv/linux/alpha/bits/elfclass.h: Define Elf_Symndx

ChangeLog
sysdeps/posix/getaddrinfo.c

index 77b9972029c5842d47d711013d9fbf1ea25ef183..8992b80ab608c58eac0595a596b7b63cbfccd9f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-07-27  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/posix/getaddrinfo.c (gaih_inet): Only return information
+       for the hinted protocol.
+
 1999-07-26  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
 
        * time/Versions: Add POSIX.1b timer and clock functions to GLIBC_2.2.
@@ -9,7 +14,7 @@
        * elf/dl-load.c (_dl_map_object): Likewise.
        * elf/do-lookup.h (do_lookup*): Likewise.
        * sysdeps/generic/bits/elfclass.h: Define Elf_Symndx as uint32_t.
-       * sysdeps/unix/sysv/linux/alpha/bits/elfclass.h: Define Elf_symndx
+       * sysdeps/unix/sysv/linux/alpha/bits/elfclass.h: Define Elf_Symndx
        as uint64_t.
        * elf/elf.h: Remove Elf32_Symndx and Elf64_Symndx.
 
index 5c7c2f4121fbd09a726e2e8e7b0e7c47814b623c..cbcb109294b5f95e116ee15f83394d6e669c5096 100644 (file)
@@ -337,17 +337,15 @@ gaih_inet (const char *name, const struct gaih_service *service,
   if (name != NULL)
     {
       at = __alloca (sizeof(struct gaih_addrtuple));
-      if (at == NULL)
-       return -EAI_MEMORY;
 
       at->family = 0;
       at->next = NULL;
 
-      if (at->family || !req->ai_family || (req->ai_family == AF_INET))
+      if (req->ai_family == 0 || req->ai_family == AF_INET)
        if (inet_pton (AF_INET, name, at->addr) > 0)
          at->family = AF_INET;
 
-      if (!at->family && (!req->ai_family || (req->ai_family == AF_INET6)))
+      if (!at->family && (req->ai_family == 0 || req->ai_family == AF_INET6))
        if (inet_pton (AF_INET6, name, at->addr) > 0)
          at->family = AF_INET6;
 
@@ -356,10 +354,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
          struct hostent *h;
          struct gaih_addrtuple **pat = &at;
 
-         if ((req->ai_family == AF_UNSPEC) || (req->ai_family == AF_INET6))
+         if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6)
            gethosts (AF_INET6, struct in6_addr);
 
-         if ((req->ai_family == AF_UNSPEC) || (req->ai_family == AF_INET))
+         if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET)
            gethosts (AF_INET, struct in_addr);
        }
 
@@ -369,24 +367,30 @@ gaih_inet (const char *name, const struct gaih_service *service,
     }
   else
     {
-      at = __alloca (sizeof(struct gaih_addrtuple));
-      if (at == NULL)
-       return -EAI_MEMORY;
-
+      struct gaih_addrtuple *atr;
+      atr = at = __alloca (sizeof(struct gaih_addrtuple));
       memset (at, 0, sizeof(struct gaih_addrtuple));
 
-      at->next = __alloca (sizeof(struct gaih_addrtuple));
-      if (at->next == NULL)
-       return -EAI_MEMORY;
+      if (req->ai_family == 0)
+       {
+         at->next = __alloca (sizeof(struct gaih_addrtuple));
+         memset (at->next, 0, sizeof(struct gaih_addrtuple));
+       }
 
-      at->family = AF_INET6;
-      if ((req->ai_flags & AI_PASSIVE) == 0)
-       memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr));
+      if (req->ai_family == 0 || req->ai_family == AF_INET6)
+       {
+         at->family = AF_INET6;
+         if ((req->ai_flags & AI_PASSIVE) == 0)
+           memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr));
+         atr = at->next;
+       }
 
-      memset (at->next, 0, sizeof(struct gaih_addrtuple));
-      at->next->family = AF_INET;
-      if ((req->ai_flags & AI_PASSIVE) == 0)
-       *(uint32_t *) at->next->addr = htonl (INADDR_LOOPBACK);
+      if (req->ai_family == 0 || req->ai_family == AF_INET)
+       {
+         atr->family = AF_INET;
+         if ((req->ai_flags & AI_PASSIVE) == 0)
+           *(uint32_t *) atr->addr = htonl (INADDR_LOOPBACK);
+       }
     }
 
   if (pai == NULL)
@@ -571,21 +575,22 @@ getaddrinfo (const char *name, const char *service,
 
   while (g->gaih)
     {
-      if ((hints->ai_family == g->family) || (hints->ai_family == AF_UNSPEC))
+      if (hints->ai_family == g->family || hints->ai_family == AF_UNSPEC)
        {
          j++;
-         if ((pg == NULL) || (pg->gaih != g->gaih))
+         if (pg == NULL || pg->gaih != g->gaih)
            {
              pg = g;
-             if ((i = g->gaih (name, pservice, hints, end)))
+             i = g->gaih (name, pservice, hints, end);
+             if (i != 0)
                {
-                 if ((hints->ai_family == AF_UNSPEC) && (i & GAIH_OKIFUNSPEC))
+                 if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC))
                    continue;
 
                  if (p)
                    freeaddrinfo (p);
 
-                 return (i)?-(i & GAIH_EAI):EAI_NONAME;
+                 return -(i & GAIH_EAI);
                }
              if (end)
                while(*end) end = &((*end)->ai_next);