]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(gaih_inet): For non-passive connections without a hostname set address to
authorUlrich Drepper <drepper@redhat.com>
Mon, 12 Jul 1999 21:31:45 +0000 (21:31 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 12 Jul 1999 21:31:45 +0000 (21:31 +0000)
localhost address.

sysdeps/posix/getaddrinfo.c

index 6810963357c374a2fb8aafdd657e6f9da8b9012a..5c7c2f4121fbd09a726e2e8e7b0e7c47814b623c 100644 (file)
@@ -380,9 +380,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
        return -EAI_MEMORY;
 
       at->family = AF_INET6;
+      if ((req->ai_flags & AI_PASSIVE) == 0)
+       memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr));
 
       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 (pai == NULL)