Crash in gethostbyname() on congruent usage

Rich Felker dalias at aerifal.cx
Wed Dec 12 17:05:55 UTC 2012


On Wed, Dec 12, 2012 at 04:46:11PM +0100, Laurent Bercot wrote:
> On Wed, Dec 12, 2012 at 09:55:43AM -0500, Rich Felker wrote:
> > Really, you should be using the modern
> > interface, getaddrinfo, and forgetting you ever heard of
> > gethostbyname, since we're almost in 2013 and gethostbyname, by
> > design, cannot support IPv6.
> 
>  Obligatory rant against getaddrinfo() :
>  http://lists.busybox.net/pipermail/busybox/2012-July/078123.html
> (The next two messages in the thread are small errata.)
> 
>  Conclusion : if you need to perform DNS resolution, as opposed to NSS
> resolution, forget you ever heard about getaddrinfo() as well, and use
> a real DNS client library. :P

The thread you referenced is all silly; it's a rant about an
implementation detail (NSS) of glibc that does not even apply to
uClibc. If you want to lookup hostnames, you use getaddrinfo. If
that's doing something other than straight DNS, that's because the
administrator has a damn good reason to want hostname lookups to be
performed in some other way, and it's not an application's business to
try to circumvent that.

Rich


More information about the uClibc mailing list