diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-10-14 20:56:52 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-10-14 20:56:52 +0000 |
commit | a33c43a5aefbbb2d1e00432ba034d256af0008ae (patch) | |
tree | 80aa9060de68814fb13960b308a0faa95fb8ba94 /sysdeps | |
parent | 4cee966cabbbd52c38260dff95f5ab43772ba5d9 (diff) | |
download | glibc-a33c43a5aefbbb2d1e00432ba034d256af0008ae.tar glibc-a33c43a5aefbbb2d1e00432ba034d256af0008ae.tar.gz glibc-a33c43a5aefbbb2d1e00432ba034d256af0008ae.tar.bz2 glibc-a33c43a5aefbbb2d1e00432ba034d256af0008ae.zip |
Updated to fedora-glibc-20071014T1847
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 221b41dd00..8f37ec5c11 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -1002,6 +1002,7 @@ struct sort_result { struct addrinfo *dest_addr; struct sockaddr_storage source_addr; + size_t service_order; uint8_t source_addr_len; bool got_source_addr; uint8_t source_addr_flags; @@ -1403,8 +1404,11 @@ rfc3484_sort (const void *p1, const void *p2) } - /* Rule 10: Otherwise, leave the order unchanged. */ - return 0; + /* Rule 10: Otherwise, leave the order unchanged. To ensure this + compare with the value indicating the order in which the entries + have been received from the services. NB: no two entries can have + the same order so the test will never return zero. */ + return a1->service_order < a2->service_order ? -1 : 1; } @@ -1951,6 +1955,7 @@ getaddrinfo (const char *name, const char *service, { results[i].dest_addr = q; results[i].got_source_addr = false; + results[i].service_order = i; /* If we just looked up the address for a different protocol, reuse the result. */ |