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 <guy@xxxxxxxxxx>
Date: Thu, 12 Jul 2001 18:43:13 -0700 (PDT)
> I was trying to get IPv6 name resolution working with Solaris8

Does Solaris 8 come with IPv6 support, or is it an add-on?

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.

> The interesting file in epan/ is resolv.c which contains conditional
> code in a #ifdef INET6 block that calls gethostbyaddr(..., AF_INET6).
> The January 22 dated sources I have on the disk do not have epan/
> directory and resolv.c resides in the top level directory. To me it
> looks like there is currently no method putting -DINET6 in
> epan/Makefile even if the autodetection code in acinclude.m4 founds a
> working IPv6 resolver. Is this so,

It was true, but I just checked in a fix.

> +		solaris8)
> +			if test "`uname -s`"="SunOS" && test "`uname -r`"="5.8"; then
> +				v6type=$i
> +				v6lib=inet6
> +				[CFLAGS="-DINET6 -DSOLARIS8_INET6 $CFLAGS"]
> +			fi
> +			;; 

You need spaces around the "=" operators, otherwise it thinks Solaris
2.6 is Solaris 8.

> Index: epan/resolv.c
> ===================================================================
> RCS file: /cvsroot/ethereal/epan/resolv.c,v
> retrieving revision 1.11
> diff -u -r1.11 resolv.c
> --- resolv.c	2001/06/07 22:07:02	1.11
> +++ resolv.c	2001/07/12 16:34:37
> @@ -1055,7 +1055,11 @@
>  #ifdef INET6
>    if (!(prefs.name_resolve & PREFS_RESOLV_NETWORK))
>      return ip6_to_str(addr);
> +#ifdef SOLARIS8_INET6
> +  if (IN6_IS_ADDR_LINKLOCAL((struct in6_addr*)addr) || IN6_IS_ADDR_MULTICAST((struct in6_addr*)addr))
> +#else
>    if (IN6_IS_ADDR_LINKLOCAL(addr) || IN6_IS_ADDR_MULTICAST(addr))
> +#endif
>      return ip6_to_str(addr);
>  #endif

I.e., you have to cast it to "struct in6_addr *" to get it to work on
Solaris 8?