Ordering of nameserver addresses in resolver state struct

Michal Sekletár sekletar.m@gmail.com
Thu Sep 19 21:13:00 GMT 2013


Hi glibc hackers,

I came across following fact which to me seems like an inconsistency, maybe
worth to fix.

Consider system which has dns resolver configured with 3 dns server
addresses. Second address is IPv6 other two are IPv4 addresses, please keep the
ordering in mind.

State of dns resolver is such that arrays of nameserver addresses nsaddr_list
contains two entries and the third one contains all zeroes. This doesn't
correspond to the order of nameservers in /etc/resolv.conf since IPv4
nameservers are first and third in the file. However array _u._ext.nsaddrs
containing pointers to sockaddr_in6 structures has following content : [nil, ptr
, nil]. It reflects ordering in resolv.conf.

Is this intentional? I think that order in later case should be [ptr, nil, nil].

Cheers,

Michal



More information about the Libc-help mailing list