Ethereal-dev: Re: [Ethereal-dev] Doubts about IPv6 name resolution

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Fri, 18 Jan 2002 00:54:21 -0800
On Fri, Jul 13, 2001 at 11:46:15AM +0300, Heikki Vatiainen wrote:
> > If it's an add-on, you'd need to check not only for Solaris 8 (although
> > you might want to check for SunOS 5.8 or later, rather than just SunOS
> > 5.8), but also check whether it has the IPv6 support.
> 
> I was thinking about turning it on always since looks like the library
> support is always there. That way ethereal binary would work on a IPv6
> enabled Solaris 8 box even if it was compiled on a non-IPv6 enabled
> box.
> 
> I did not think about checking later than 5.8 since gethostbyaddr()
> for IPv6 might go away. At least the manual says that:
> 
>      The current implementations of these functions  only  return
>      or  accept  addresses  for the Internet address family (type
>      AF_INET).
> 
> Thinking a bit further, a Solaris 8 binary may even break with
> e.g. Solaris 9 if this undocumented feature is removed from libnsl.
> 
> A better method might be using getipnodebyname() from RFC 2553 if name
> resolution for Solaris 8 is desired, but one problem with that is
> draft-ietf-ipngwg-rfc2553bis-03.txt says:
> 
>   Changes made to rfc2553bis-00 to rfc2553bis-01
>      1.  Removed all references to getipnodebyname() and
>          getipnodebyaddr().

draft-ietf-ipngwg-rfc2553bis-04.txt says that the right way to translate
addresses to names is with "getnameinfo()", from the 1003.1-200x
specification; they speak of it as a draft, as it presumably was at the
time, but it's now IEEE Std 1003.1-2001 (Open Group Technical Standard,
Issue 6), which is the result of the work done by the Austin Group
merging chunks of the Single UNIX Specification into an updated POSIX
specification:

	http://www.opengroup.org/austin/

(the FAQ for which includes question 13 "I filed an aardvark but did not
see a copy on the mailing list. Problem?" - with a name like the Austin
Group, I'd have expected it to be an armadillo :-), but as for
aardvarks:

	http://www.opengroup.org/austin/aardvark/

but I digress).

> However, since Sun says "uses it" it may be a good idea to use now and
> not wait for something that's still a draft. Any folks with better
> IPv6 knowledge care to comment?

The Solaris 8 man page for "getnameinfo()" on the docs.sun.com site
indicates that it exists in Solaris 8 and supports IPv6.

On the other hand, there's also a man page for "getipnodebyname()" in
the same manual set, and it doesn't speak of it going away, either -
perhaps too much software has been written to use it.  It may be that
RFC2553bis can only deprecate it in favor of "getnameinfo()", as the
latter is part of a POSIX standard and the former isn't, so that *new*
code should use "getnameinfo()" as it may eventually be more common than
"getipnodebyname()".

So perhaps our strategy for IPv6 address-to-name resolution should be:

	if the platform has "getnameinfo()", use it;

	otherwise, if the platform has "getipnodebyname()", use it;

	otherwise, use "gethostbyaddr()", and hope it handles AF_INET6.