In article <397BB7F2.FF2F459(a)666.com> (at Sun, 23 Jul 2000 20:28:50 -0700), Ben Wing
<ben(a)666.com> says:
> - Use the old interface gethostbyname by default, and provide a
> --with-getaddrinfo configure switch for the adventurous. We change
> to make --with-getaddrinfo the default some time in the future, when
> "most" users have a system that implements getaddrinfo() well.
i think this is the best idea. it hardly matters if we don't fetch our
canonical hostname -- and i can guarantee you that zillions of people do, and
will, have this misconfigured for a very long time, esp. when they're playing
tricks like ip masquerading.
Again, I'd like to emphasise AF_INET and AI_ADDRCONFIG flag hints for
getaddrinfo() will fix your (*)problem (that is, it could take a long
time to resolve nodenames), so prepare a new configuration (or runtime)
variable that switches protocol family (PF_UNSPEC vs PF_INET vs PF_INET6)
hints for getaddrinfo(), and specify AI_ADDRCONFIG when it is possible
to use it.
Please forget gethostbyname() whenever you can use non-buggy getaddrinfo().
-------------+---------------+---------------------------------------------
getaddrinfo | AI_ADDRCONFIG | recommended method
-------------+---------------+---------------------------------------------
good | ok | getaddrinfo() with PF_UNSPEC & AI_ADDRCONFIG
good | ng | getaddrinfo() with PF_INET
buggy / no | don't care | gethostbyname()
-------------+---------------+---------------------------------------------
Note: your (*)problem is not buggy behavior of getaddrinfo() in above table.
Any comments?
--
Hideaki YOSHIFUJI <yoshfuji(a)ecei.tohoku.ac.jp>
Web Page:
http://www.ecei.tohoku.ac.jp/%7Eyoshfuji/
PGP5i FP: F731 6599 5EB2 BBA7 1515 1323 1806 A96F 5700 6B25