* sysdeps/posix/getaddrinfo.c (gaih_inet): For AI_CANONNAME,
determine the canonical name only for the first returned entry.
2004-06-18 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): For AI_CANONNAME,
+ determine the canonical name only for the first returned entry.
+
* inet/bug-if1.c: New file.
* inet/Makefile (tests): Add bug-if1.
return 0;
{
- const char *c = NULL;
struct gaih_servtuple *st2;
struct gaih_addrtuple *at2 = at;
size_t socklen, namelen;
*/
while (at2 != NULL)
{
- if (req->ai_flags & AI_CANONNAME)
+ const char *c = NULL;
+
+ /* Only the first entry gets the canonical name. */
+ if (at2 == at && (req->ai_flags & AI_CANONNAME) != 0)
{
struct hostent *h = NULL;