This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/14990] getaddrinfo with servname=NULL returns duplicate addresses
- From: "psimerda at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 11 Jan 2013 15:58:28 +0000
- Subject: [Bug network/14990] getaddrinfo with servname=NULL returns duplicate addresses
- Auto-submitted: auto-generated
- References: <bug-14990-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14990
--- Comment #2 from Pavel Åimerda <psimerda at redhat dot com> 2013-01-11 15:58:28 UTC ---
The code for #3a could look something like this:
if (!servname)
{
/* POSIX1-2008: If servname is null, the call shall return network-level
* addresses for the specified nodename.
*
* Example:
*
* getaddrinfo ("localhost", NULL, ...) ->
* family=AF_INET6 socktype=0 protocol=0 address=::1 port=0
* family=AF_INET socktype=0 protocol=0 address=127.0.0.1 port=0
*/
struct gaih_servtuple *st = malloc (sizeof (struct gaih_servtuple));
st->next = NULL;
st->port = 0;
/* Copy socktype and protocol from the request. This maintains backwards
* compatibility. Callers should not set socktype and protocol when
* service is NULL.
*/
st->socktype = socktype;
st->protocol = protocol;
*servtuple = st;
return 0;
}
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.