diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-07-12 21:31:45 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-07-12 21:31:45 +0000 |
commit | c7aca6f6bd1e6bc2a1657f5fa574a23210a26a66 (patch) | |
tree | 1e297abd61da04a0894af5dec63a437ee8eef4e0 /sysdeps | |
parent | d411ce85255e7e9aa11cb81e812df4acda36d6c1 (diff) |
(gaih_inet): For non-passive connections without a hostname set address to
localhost address.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 6810963357..5c7c2f4121 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -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) |