bug-inetutils
[Top][All Lists]
Advanced

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

Re: [bug-inetutils] A command to query the libc resolver


From: Tanguy Ortolo
Subject: Re: [bug-inetutils] A command to query the libc resolver
Date: Wed, 18 Aug 2010 11:18:48 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Le mercredi 18 août 2010, Sergey Poznyakoff a écrit :
> > It is currently quite rough: no localization, no options, and so on. But
> > I think it just works. Do you think such a tool would be worth being
> > integrated to some software suite, such as inetutils?
> 
> Such a tool would certainly be useful. However, I have serveral
> questions regarding the implementation:
> 
> 1. You use gethostbyname2, which is a glibc extension and is not
> available on other systems. I'd suggest to use getaddrinfo instead.

At first time, I tried using gethostbyname, but it seems to support only
AF_INET, and returns NULL when asked for a hostname that only resolves
to an IPv6 address. Then I looked to getaddrinfo, but it seems to
require a service name, that is inappropriate for simple name
resolution…

> 2. The code handles only AF_INET and AF_INET6 families. If another
> family is encountered, its behavior is uncertain.

Indeed. I was surprised to see that gethostbyname2(3) only mentionned
these families. If I can use getaddrinfo, I shall handle other families
in a generic way.

> 3. The code declares variables within a code block.

Right, thank you, this is easy to fix.

-- 
Tanguy Ortolo

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]