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

Bug#438179: marked as done (getaddrinfo() sorts results.)



Your message dated Thu, 16 Aug 2007 20:24:51 +0200
with message-id <46C49673.3030807@aurel32.net>
and subject line Bug#438179: getaddrinfo() sorts results.
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
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



--- End Message ---
--- Begin Message ---
Kurt Roeckx a écrit :
> 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.
> 

This is a feature, not a bug. getaddrinfo() sorts results according to
RFC3484. You can configure the way they are sorted using /etc/gai.conf.

If you don't want results to be sorted, don't use getaddrinfo().

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

--- End Message ---

Reply to: