Re: [Exim] getipnodebyaddr was: Exim 4.03 is available

Top Page
Delete this message
Reply to this message
Author: Patrice Fournier
Date:  
To: exim-users, Philip Hazel
CC: Arkadiusz Miskiewicz, exim-users
Old-Topics: Re: [Exim] Exim 4.03 is available
Subject: Re: [Exim] getipnodebyaddr was: Exim 4.03 is available
Quoting Philip Hazel <ph10@???>:

> > Please revert this change.
>
> I was asked to make this change because (someone asserted)
> gethostbyaddr in Linux doesn't work with IPv6 addresses. (It works
> fine in Solaris.)


Ok, I'm the one to blame for this... When testing IPv6 support, Exim
wouldn't return the hostname of any IPv6 host I tried as -bh even though
they had reverse dns entries. So while searching for a cause to this, I did
look at the man page to gethostbyaddr which stated the following (Debian
Woody 3.0 (aka Testing)):

       The  gethostbyaddr()  function returns a structure of type
       hostent for the given host address addr of length len  and
       address  type  type.   The only valid address type is cur­
       rently AF_INET.


and in the notes at the end:

       The Austin draft marks gethostbyaddr() and gethostbyname()
       legacy, and introduces


       struct hostent *getipnodebyaddr (const void *restrict addr,
         socklen_t len, int type, int *restrict error_num);


       struct hostent *getipnodebyname (const char *name,
         int type, int flags, int *error_num);


And the only mention of getaddrinfo is in the SEE ALSO section of
getipbyaddr. Those manual pages are dated December 2000 which is not that
far ago. Now, it seems we can't trust man pages anymore :(

> So, folks, I don't know what to do here. I have conflicting
> information coming at me. What is the real story?


I was misinformed by those man pages, I can confirm that 4.03 complains
about unknown reference to those functions.

Oh, and the reason Exim wouldn't return hostname seems to be with glibc not
looking in the ip6.int but only in the almost unused (ok, I may exagerate
here, but all the hosts (not that many though) I checked used ip6.int)
ip6.arpa.

See http://sources.redhat.com/ml/libc-alpha/2002-02/msg00030.html

> > ps. getaddrinfo internally uses gethostbyname2() while getnameinfo()
> > uses gethostbyaddr() + gethostbyname() in glibc.


Ok, so has I can't trust the man pages and I've found someone saying that
glibc is not looking at the ip6.int registry, I believe gethostbyaddr are
probably ok in Linux. I just need to find another way to get the hostname
than relying on glibc. :(

Sorry Philip, I'm sure you could have used that time on something else..
next time, I won't depend on the man pages when asking for something.

Now, does anyone know of an IPv6 address that maps to a hostname in the
ip6.arpa registry so that I can verify that all this information is valid?


--
Patrice Fournier
pfournier@???