Hi Nenad, On Mon, Jul 25, 2016 at 10:30:55AM +0200, Nenad Merdanovic wrote: > Hello Willy, > > On 7/20/2016 9:28 PM, Willy Tarreau wrote: > > I vaguely remind such a conversation in the past with reports of > > getaddrinfo() not returning what was expected. Maybe that's something > > to consider for a next major version (eg: 1.7). However we could > > possibly have something intermediary for 1.6 : having the option to > > force to use GAI and not use it by default. That wouldn't break existing > > setups and would allow those who need it to use it as-is. We'd basically > > build with "USE_GHBN_FIRST" in addition to "USE_GETADDRINFO", it would > > then use only gethostbyname except if the option forces the other one. > > > > Does this sound like a reasonable option ? > > It sounds fine, until I think all the various ways we enable or disable > this. We have: > - Build option to build with gai(), preferring it > - Runtime flag to disable gai(), falling back to ghbn() > - Configuration option to disable gai(), falling back to ghbn() > > Now we would need to add: > - Build option to prefer ghbn() when gai() is enabled > - A configuration option/runtime flag to switch back to gai() in the > case above > > I am pretty familiar with this part of the code, and it makes my head > hurt :) > > I'd vote to keep 1.6 as is, and completely break 1.7 by removing the > build option USE_GETADDRINFO and building with it by default, perhaps > switching to NO_GETADDRINFO for any platforms that are broken (if such > exist). We then just keep the runtime flag/config option for people who > wish to disable it.
We definitely need to have an option to disable it, because getaddrinfo is broken on *many* platforms. In fact when implementing it I had a hard time finding a really working one. Not kidding. Things have evolved since, but legacy systems are still used quite a lot with either no or a broken implementation (broken in various ways), and several embedded libraries don't have a working one either or only recently fixed theirs. Otherwise I'm fine with your proposal (ie make it the default starting with 1.7 and not touch 1.6). Regards, willy

