Ethereal-dev: [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: Heikki Vatiainen <hessu@xxxxxxxxx>
Date: 12 Jul 2001 21:18:10 +0300
Is the IPv6 name resolution really working with the recent versions of
Ethereal?

I was trying to get IPv6 name resolution working with Solaris8 and
Linux and the only way to get it working was to manually add -DINET6
in CFLAGS in epan/Makefile. Solaris8 also required a small patch, more
about it later.

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, or am I barking the wrong tree.

Anyway, the Solaris8 IPv6 enabling patch is below. It still requires
manually patching epan/Makefile to get -DINET6 -DSOLARIS8_INET6 in
CFLAGS. The resolv.c patch is a gross hack but it works.


Index: acinclude.m4
===================================================================
RCS file: /cvsroot/ethereal/acinclude.m4,v
retrieving revision 1.28
diff -u -r1.28 acinclude.m4
--- acinclude.m4	2001/07/09 23:42:39	1.28
+++ acinclude.m4	2001/07/12 16:34:36
@@ -103,7 +103,7 @@
 	v6lib=none
 
 	AC_MSG_CHECKING([ipv6 stack type])
-	for i in v6d toshiba kame inria zeta linux linux-glibc; do
+	for i in v6d toshiba kame inria zeta linux linux-glibc solaris8; do
 		case $i in
 		v6d)
 			AC_EGREP_CPP(yes, [
@@ -171,6 +171,13 @@
 #endif],
 			[v6type=$i; v6lib=inet6; CFLAGS="-DINET6 $CFLAGS"])
 			;;
+		solaris8)
+			if test "`uname -s`"="SunOS" && test "`uname -r`"="5.8"; then
+				v6type=$i
+				v6lib=inet6
+				[CFLAGS="-DINET6 -DSOLARIS8_INET6 $CFLAGS"]
+			fi
+			;; 
 		esac
 		if test "$v6type" != "unknown"; then
 			break
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
 




-- 
Heikki Vatiainen                  * hessu@xxxxxxxxx
Tampere University of Technology  * Tampere, Finland