From 86421aa57ecfd70963ae66848bd6a6dd3b8e0fe6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 12 Jul 1999 21:28:32 +0000 Subject: Update. 1999-07-12 Ulrich Drepper * sysdeps/posix/getaddrinfo.c (gaih_inet): For non-passive connections without a hostname set address to localhost address. --- sysdeps/posix/getaddrinfo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/posix') 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) -- cgit 1.4.1