mirror of git://sourceware.org/git/glibc.git
Update.
* sysdeps/posix/getaddrinfo.c (getaddrinfo): I rfc3484 sorting is performed, make sure it is still the first entry after sotring which has the ai_canonname information.
This commit is contained in:
parent
97306b0b34
commit
c7fa647a10
|
@ -1,5 +1,9 @@
|
||||||
2004-08-14 Ulrich Drepper <drepper@redhat.com>
|
2004-08-14 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/posix/getaddrinfo.c (getaddrinfo): I rfc3484 sorting is
|
||||||
|
performed, make sure it is still the first entry after sotring
|
||||||
|
which has the ai_canonname information.
|
||||||
|
|
||||||
* sysdeps/posix/getaddrinfo.c (gaih_inet): Really set ai_canonname
|
* sysdeps/posix/getaddrinfo.c (gaih_inet): Really set ai_canonname
|
||||||
only in one entry.
|
only in one entry.
|
||||||
|
|
||||||
|
|
|
@ -1437,6 +1437,7 @@ getaddrinfo (const char *name, const char *service,
|
||||||
/* Sort results according to RFC 3484. */
|
/* Sort results according to RFC 3484. */
|
||||||
struct sort_result results[nresults];
|
struct sort_result results[nresults];
|
||||||
struct addrinfo *q;
|
struct addrinfo *q;
|
||||||
|
char *canonname = NULL;
|
||||||
|
|
||||||
for (i = 0, q = p; q != NULL; ++i, q = q->ai_next)
|
for (i = 0, q = p; q != NULL; ++i, q = q->ai_next)
|
||||||
{
|
{
|
||||||
|
@ -1459,6 +1460,14 @@ getaddrinfo (const char *name, const char *service,
|
||||||
|
|
||||||
close_not_cancel_no_status (fd);
|
close_not_cancel_no_status (fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Remember the canonical name. */
|
||||||
|
if (q->ai_canonname != NULL)
|
||||||
|
{
|
||||||
|
assert (canonname == NULL);
|
||||||
|
canonname = q->ai_canonname;
|
||||||
|
q->ai_canonname = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We got all the source addresses we can get, now sort using
|
/* We got all the source addresses we can get, now sort using
|
||||||
|
@ -1470,6 +1479,9 @@ getaddrinfo (const char *name, const char *service,
|
||||||
for (i = 1; i < nresults; ++i)
|
for (i = 1; i < nresults; ++i)
|
||||||
q = q->ai_next = results[i].dest_addr;
|
q = q->ai_next = results[i].dest_addr;
|
||||||
q->ai_next = NULL;
|
q->ai_next = NULL;
|
||||||
|
|
||||||
|
/* Fill in the canonical name into the new first entry. */
|
||||||
|
p->ai_canonname = canonname;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
|
|
Loading…
Reference in New Issue