[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#438179: getaddrinfo() sorts results.



Package: glibc
Version: 2.6.1-1
Severity: important


Hi,

It seems that getaddrinfo() seems to sort the results, which defeats the
point of having multiple A-records in the first place.

If I look up 0.pool.ntp.org I (now) get:
0.pool.ntp.org has address 193.39.78.2
0.pool.ntp.org has address 195.34.187.132
0.pool.ntp.org has address 202.73.37.27
0.pool.ntp.org has address 212.24.114.156
0.pool.ntp.org has address 217.116.227.3
0.pool.ntp.org has address 62.75.136.76
0.pool.ntp.org has address 62.245.224.171
0.pool.ntp.org has address 64.5.1.129
0.pool.ntp.org has address 66.180.136.186
0.pool.ntp.org has address 80.86.83.133
0.pool.ntp.org has address 81.169.172.219
0.pool.ntp.org has address 85.25.252.58
0.pool.ntp.org has address 88.198.8.101
0.pool.ntp.org has address 91.121.13.62

But getaddrinfo() will always return ip's in this order:
62.75.136.76
62.245.224.171
64.5.1.129
[...]

There seems to be some variation in the list, but the first 4 or 5 are
always the same.  I only care about the first one.

It should keep the order of the A-records the same as they were returned
by the dns server.


Kurt




Reply to: