projects
/
platform
/
upstream
/
linaro-glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad46371
)
(gaih_inet): Set socket address to loopback if no name is given and AI_PASSIVE is...
author
Ulrich Drepper
<drepper@redhat.com>
Mon, 24 May 1999 08:18:43 +0000
(08:18 +0000)
committer
Ulrich Drepper
<drepper@redhat.com>
Mon, 24 May 1999 08:18:43 +0000
(08:18 +0000)
sysdeps/posix/getaddrinfo.c
patch
|
blob
|
history
diff --git
a/sysdeps/posix/getaddrinfo.c
b/sysdeps/posix/getaddrinfo.c
index
f43aa03
..
7217e5d
100644
(file)
--- a/
sysdeps/posix/getaddrinfo.c
+++ b/
sysdeps/posix/getaddrinfo.c
@@
-383,6
+383,14
@@
gaih_inet (const char *name, const struct gaih_service *service,
memset (at->next, 0, sizeof(struct gaih_addrtuple));
at->next->family = AF_INET;
+
+ if (!(req->ai_flags & AI_PASSIVE))
+ {
+ /* RFC 2553 requires to set set the socket address structure
+ to the loopback address in this case. */
+ memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr));
+ ((struct in_addr *)at->next->addr)->s_addr = htonl (INADDR_LOOPBACK);
+ }
}
if (pai == NULL)