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

ipv6 patch



	Hello, sorry that I did not sent this before 0.0u...
	The attached patches will make the following two changes:
	- "configure" identifies IPv6 stack type by header files, link
	  appropriate library files.
	- bind AF_INET6 socket and AF_INET socket, for IPv6 implementations
	  without IPv6 "mapped addr".
	patch is checked with 0.0u.  I hope this to be integrated into 0.1x.

itojun


diff -cr aclocal.m4 aclocal.m4
*** aclocal.m4	Sat Jun 13 11:19:30 1998
--- aclocal.m4	Tue Jun 23 22:17:30 1998
***************
*** 932,938 ****
  ac_cv_lib_ipv6=yes,
  ac_cv_lib_ipv6=no))
  if test "$ac_cv_lib_ipv6" = yes; then
!   AC_DEFINE(HAVE_IPV6)
  fi
  ])
  
--- 932,1025 ----
  ac_cv_lib_ipv6=yes,
  ac_cv_lib_ipv6=no))
  if test "$ac_cv_lib_ipv6" = yes; then
! 	AC_DEFINE(HAVE_IPV6)
! 
! 	dnl following part is added by itojun.
! 	v6type=unknown
! 	v6lib=none
! 
! 	AC_MSG_CHECKING([ipv6 stack type])
! 	for i in v6d toshiba kame inria zeta linux; do
! 		case $i in
! 		v6d)
! 			AC_EGREP_CPP(yes, [dnl
! #include </usr/local/v6/include/sys/types.h>
! #ifdef __V6D__
! yes
! #endif],
! 				[v6type=$i; v6lib=v6;
! 				v6libdir=/usr/local/v6/lib;
! 				CFLAGS="-I/usr/local/v6/include $CFLAGS"])
! 			;;
! 		toshiba)
! 			AC_EGREP_CPP(yes, [dnl
! #include <sys/param.h>
! #ifdef _TOSHIBA_INET6
! yes
! #endif],
! 				[v6type=$i; v6lib=inet6;
! 				v6libdir=/usr/local/v6/lib;
! 				CFLAGS="-DINET6 $CFLAGS"])
! 			;;
! 		kame)
! 			AC_EGREP_CPP(yes, [dnl
! #include <netinet/in.h>
! #ifdef __KAME__
! yes
! #endif],
! 				[v6type=$i; v6lib=inet6;
! 				v6libdir=/usr/local/v6/lib;
! 				CFLAGS="-DINET6 $CFLAGS"])
! 			;;
! 		inria)
! 			AC_EGREP_CPP(yes, [dnl
! #include <netinet/in.h>
! #ifdef IPV6_INRIA_VERSION
! yes
! #endif],
! 				[v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
! 			;;
! 		zeta)
! 			AC_EGREP_CPP(yes, [dnl
! #include <sys/param.h>
! #ifdef _ZETA_MINAMI_INET6
! yes
! #endif],
! 				[v6type=$i; v6lib=inet6;
! 				v6libdir=/usr/local/v6/lib;
! 				CFLAGS="-DINET6 $CFLAGS"])
! 			;;
! 		linux)
! 			if test -d /usr/inet6; then
! 				v6type=$i
! 				v6lib=inet6
! 				v6libdir=/usr/inet6
! 				CFLAGS="-DINET6 $CFLAGS"
! 			fi
! 			;;
! 		esac
! 		if test "$v6type" != "unknown"; then
! 			break
! 		fi
! 	done
! 	AC_MSG_RESULT($v6type)
! 
! 	if test "$v6lib" != "none"; then
! 		for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
! 			if test -d $dir -a -f $dir/lib$v6lib.a; then
! 				LIBS="-L$dir -l$v6lib $LIBS"
! 				break
! 			fi
! 		done
! dnl		AC_CHECK_LIB($v6lib, getaddrinfo,
! dnl			[SERVER_LIBS="-l$v6lib $SERVER_LIBS"],
! dnl			[dnl
! dnl			echo "Fatal: no $v6lib library found.  cannot continue."
! dnl			echo "You need to fetch lib$v6lib.a from appropriate v6 kit and"
! dnl			echo 'compile beforehand.'
! dnl			exit 1])
! 	fi
! 
  fi
  ])
  
diff -cr configure configure
--- configure	Sun Jan 31 06:56:37 1999
+++ configure	Sun Jan 31 13:05:39 1999
@@ -8721,17 +8721,147 @@
 
 echo "$ac_t""$ac_cv_lib_ipv6" 1>&6
 if test "$ac_cv_lib_ipv6" = yes; then
-  cat >> confdefs.h <<\EOF
+	cat >> confdefs.h <<\EOF
 #define HAVE_IPV6 1
 EOF
 
+
+		v6type=unknown
+	v6lib=none
+
+	echo $ac_n "checking ipv6 stack type""... $ac_c" 1>&6
+echo "configure:8734: checking ipv6 stack type" >&5
+	for i in v6d toshiba kame inria zeta linux; do
+		case $i in
+		v6d)
+			cat > conftest.$ac_ext <<EOF
+#line 8739 "configure"
+#include "confdefs.h"
+dnl
+#include </usr/local/v6/include/sys/types.h>
+#ifdef __V6D__
+yes
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  v6type=$i; v6lib=v6;
+				v6libdir=/usr/local/v6/lib;
+				CFLAGS="-I/usr/local/v6/include $CFLAGS"
+fi
+rm -f conftest*
+
+			;;
+		toshiba)
+			cat > conftest.$ac_ext <<EOF
+#line 8759 "configure"
+#include "confdefs.h"
+dnl
+#include <sys/param.h>
+#ifdef _TOSHIBA_INET6
+yes
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  v6type=$i; v6lib=inet6;
+				v6libdir=/usr/local/v6/lib;
+				CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+			;;
+		kame)
+			cat > conftest.$ac_ext <<EOF
+#line 8779 "configure"
+#include "confdefs.h"
+dnl
+#include <netinet/in.h>
+#ifdef __KAME__
+yes
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  v6type=$i; v6lib=inet6;
+				v6libdir=/usr/local/v6/lib;
+				CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+			;;
+		inria)
+			cat > conftest.$ac_ext <<EOF
+#line 8799 "configure"
+#include "confdefs.h"
+dnl
+#include <netinet/in.h>
+#ifdef IPV6_INRIA_VERSION
+yes
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  v6type=$i; CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+			;;
+		zeta)
+			cat > conftest.$ac_ext <<EOF
+#line 8817 "configure"
+#include "confdefs.h"
+dnl
+#include <sys/param.h>
+#ifdef _ZETA_MINAMI_INET6
+yes
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  v6type=$i; v6lib=inet6;
+				v6libdir=/usr/local/v6/lib;
+				CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+			;;
+		linux)
+			if test -d /usr/inet6; then
+				v6type=$i
+				v6lib=inet6
+				v6libdir=/usr/inet6
+				CFLAGS="-DINET6 $CFLAGS"
+			fi
+			;;
+		esac
+		if test "$v6type" != "unknown"; then
+			break
+		fi
+	done
+	echo "$ac_t""$v6type" 1>&6
+
+	if test "$v6lib" != "none"; then
+		for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
+			if test -d $dir -a -f $dir/lib$v6lib.a; then
+				LIBS="-L$dir -l$v6lib $LIBS"
+				break
+			fi
+		done
+	fi
+
 fi
 
 
 
 
 echo $ac_n "checking for struct winsize""... $ac_c" 1>&6
-echo "configure:8735: checking for struct winsize" >&5
+echo "configure:8865: checking for struct winsize" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_winsize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8739,7 +8869,7 @@
 ac_cv_struct_winsize=no
 for i in sys/termios.h sys/ioctl.h; do
 cat > conftest.$ac_ext <<EOF
-#line 8743 "configure"
+#line 8873 "configure"
 #include "confdefs.h"
 #include <$i>
 EOF
@@ -8760,7 +8890,7 @@
 fi
 echo "$ac_t""$ac_cv_struct_winsize" 1>&6
 cat > conftest.$ac_ext <<EOF
-#line 8764 "configure"
+#line 8894 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
@@ -8775,7 +8905,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 8779 "configure"
+#line 8909 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
@@ -8794,13 +8924,13 @@
 
 
 echo $ac_n "checking for struct spwd""... $ac_c" 1>&6
-echo "configure:8798: checking for struct spwd" >&5
+echo "configure:8928: checking for struct spwd" >&5
 if eval "test \"`echo '$''{'ac_cv_type_struct_spwd'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8804 "configure"
+#line 8934 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 #ifdef HAVE_SHADOW_H
@@ -8810,7 +8940,7 @@
 struct spwd foo;
 ; return 0; }
 EOF
-if { (eval echo configure:8814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_spwd=yes
 else
@@ -8836,13 +8966,13 @@
 
 
 echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6
-echo "configure:8840: checking for sa_len in struct sockaddr" >&5
+echo "configure:8970: checking for sa_len in struct sockaddr" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sockaddr_sa_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8846 "configure"
+#line 8976 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -8851,7 +8981,7 @@
 int foo = sa.sa_len;
 ; return 0; }
 EOF
-if { (eval echo configure:8855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sockaddr_sa_len=yes
 else
@@ -8876,13 +9006,13 @@
 
 for i in int8_t int16_t int32_t int64_t; do
 	echo $ac_n "checking for $i""... $ac_c" 1>&6
-echo "configure:8880: checking for $i" >&5
+echo "configure:9010: checking for $i" >&5
 	
 if eval "test \"`echo '$''{'ac_cv_type_$i'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8886 "configure"
+#line 9016 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -8900,7 +9030,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval ac_cv_type_$i=yes
 else
@@ -8926,13 +9056,13 @@
 
 for i in u_int8_t u_int16_t u_int32_t u_int64_t; do
 	echo $ac_n "checking for $i""... $ac_c" 1>&6
-echo "configure:8930: checking for $i" >&5
+echo "configure:9060: checking for $i" >&5
 	
 if eval "test \"`echo '$''{'ac_cv_type_$i'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8936 "configure"
+#line 9066 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -8950,7 +9080,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval ac_cv_type_$i=yes
 else
@@ -8979,7 +9109,7 @@
 
 
 echo $ac_n "checking for el_init""... $ac_c" 1>&6
-echo "configure:8983: checking for el_init" >&5
+echo "configure:9113: checking for el_init" >&5
 if eval "test \"`echo '$''{'ac_cv_funclib_el_init'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8994,14 +9124,14 @@
 		fi
 		LIBS="$ac_lib $ac_save_LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 8998 "configure"
+#line 9128 "configure"
 #include "confdefs.h"
 
 int main() {
 el_init()
 ; return 0; }
 EOF
-if { (eval echo configure:9005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "if test -n \"$ac_lib\";then ac_cv_funclib_el_init=$ac_lib; else ac_cv_funclib_el_init=yes; fi";break
 else
@@ -9064,7 +9194,7 @@
 
 
 echo $ac_n "checking for readline""... $ac_c" 1>&6
-echo "configure:9068: checking for readline" >&5
+echo "configure:9198: checking for readline" >&5
 if eval "test \"`echo '$''{'ac_cv_funclib_readline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9079,14 +9209,14 @@
 		fi
 		LIBS="$ac_lib $ac_save_LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 9083 "configure"
+#line 9213 "configure"
 #include "confdefs.h"
 
 int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:9090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "if test -n \"$ac_lib\";then ac_cv_funclib_readline=$ac_lib; else ac_cv_funclib_readline=yes; fi";break
 else
@@ -9201,7 +9331,7 @@
 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
 
 echo $ac_n "checking for streamspty""... $ac_c" 1>&6
-echo "configure:9205: checking for streamspty" >&5
+echo "configure:9335: checking for streamspty" >&5
 case "`uname -sr`" in
 SunOS\ 4*|OSF1*|IRIX\ 4*|HP-UX\ ?.10.*)
 	krb_cv_sys_streamspty=no
@@ -9274,7 +9404,7 @@
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep '^ac_space'` in
+  case `(ac_space=' '; set) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
try to bind to both IPv4 and IPv6 sockets.  (don't assume mapped addrs)

--- kdc/connect.c.orig	Wed Aug 19 02:07:12 1998
+++ kdc/connect.c	Wed Aug 19 02:07:27 1998
@@ -111,26 +111,23 @@
 	if(strcmp(p, "+") == 0) {
 #ifdef HAVE_IPV6
 	    add_standard_ports(AF_INET6);
-#else
-	    add_standard_ports(AF_INET);
 #endif
+	    add_standard_ports(AF_INET);
 	} else {
 	    char *q = strchr(p, '/');
 	    if(q){
 		*q++ = 0;
 #ifdef HAVE_IPV6
 		add_port(AF_INET6, p, q);
-#else
-		add_port(AF_INET, p, q);
 #endif
+		add_port(AF_INET, p, q);
 	    }else {
 #ifdef HAVE_IPV6
 		add_port(AF_INET6, p, "udp");
 		add_port(AF_INET6, p, "tcp");
-#else
+#endif
 		add_port(AF_INET, p, "udp");
 		add_port(AF_INET, p, "tcp");
-#endif
 	    }
 	}