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

Bug#438179: A comment about RFC 3484 address selection



On Sat, Sep 22, 2007 at 04:46:18PM -0400, Clint Adams wrote:
> Juliusz asked me to pass this along to -ctte since non-subscribers can't
> post.

FWIW, I believe non-subscriber posts are accepted to the list if they're
sent by way of the BTS.

> On Sat, Sep 22, 2007 at 10:14:23PM +0200, Juliusz Chroboczek wrote:
> > The semantics of gethostbyname have always been rather vaguely
> > defined.  In particular, it has never been clear whether multiple
> > addresses are returned in an order specified by the DNS server, in the
> > order corresponding to local preferences, or in some other order.  The
> > only thing that is clear is that the first address returned is the
> > preferred address -- the one that should be used by primitive
> > applications that are unwilling to deal with the complexities of
> > multiple addresses.

> > RFC 3484 clarifies that the list of addresses returned by getaddrinfo
> > is in an order that takes into account both the server's and local
> > preferences.  While this might or might not be the best semantics, it
> > is at least a well defined semantics; one that software authors can
> > expect to rely on.

a) no, the software authors cannot expect to rely on addresses to be sorted
in any particular order; RFC 3484 specifies, and /etc/gai.conf implements, a
mechanism for local admins to override the label and precedence tables used
for sorting addresses.

b) no, the software authors cannot expect to rely on addresses to be sorted
in any particular order; RFC 3484 only specifies partial sorting for
addresses, it already leaves addresses unsorted if they have the same scope,
label, and precedence and have a prefix match with the source address of the
same length.

c) no, the disputed rule in RFC 3484 does *not* take into account either the
source or destination host's preferences.  It *claims* to do so, but it
fails due to a wrong assumption that the topology of the IPv4 Internet is
heirarchical; and in the process it explicitly overrides any preferences
expressed by the server side (by way of the order in which the addresses are
returned by the DNS server).

The only thing users of getaddrinfo() should be depending on is that the
addresses are sorted in order of preference *where this can be determined*.
No application has a reason to assume anything else about the addresses
returned by getaddrinfo().

> > Please, do not change standard interfaces in Debian.  If you really
> > believe a better interface is needed, please define a new interface
> > under a new name; there is precedent to this approach (e.g. setresuid),
> > which is much better than overloading standard names (e.g. the OpenBSD
> > semantics of setuid, which, while better than the POSIX semantcs, causes
> > useless confusion and grief).

RFC 3484 is not a standard.  The right time to fix the bugs in these rules
is before they become one.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/




Reply to: