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

Re: glibc's getaddrinfo() sort order

On Thu, Sep 13, 2007 at 12:06:40AM +0100, Ian Jackson wrote:
> Does anyone have an answer to my point that application of rule 9
> changes the long-established meaning of existing DNS data ?

I'm not familiar with how getaddrinfo() has been implemented in the
past -- but I think it makes more sense to look at the definition of
the function than the data it's manipulating.

The RFC tries to make getaddrinfo return a predictable ordering in the
face of random orderings from DNS. That seems a perfectly reasonable
way to define a function in the abstract; though certainly the ordering
it comes up with can be criticised.

> I disagree with your answer to that first question.  gethostbyname
> returns results in random order.  getaddrinfo should do the same.

I'd say it's more important that getaddrinfo() on Debian behave "the same"
as on other operating systems, than that it behave in the same way as
other functions. I can only take the RFC's assertion as to getaddrinfo()'s
proper behaviour though; I don't have a more direct idea how getaddrinfo()
behaves in previous versions of Debian, other Linux distros, other libcs,
Windows, etc.

> > AFAICS, the answer to the first question is simply "no, it shouldn't" --
> > randomised load balancing like that needs to be done at the application
> > level,
> You are mistaken.  [...]

What getaddrinfo() should and shouldn't do is defined by the standard,
not by what would be most useful. :-/

FWIW, if the standard should be changed, it seems to me that it'd carry
more weight having the Debian tech ctte put that recommendation in than
a random DD.


Attachment: signature.asc
Description: Digital signature

Reply to: