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

HAVE_GETHOSTBYNAME2 does not imply HAVE_IPV6! (patches)



We're using a local build of BIND 8 on all our supported machines; its
libresolv.a provides gethostbyname2().  But only the Linux machines even
pretend to support IPV6 as yet.

Heimdal's code, unfortunately, assumes that having gethostbyname2() automatically means IPV6 is supported.

Diffs are against 0.0t, but I've applied them to 0.0u without problems.  If
any more of these are in 0.0u, you'll hear about it shortly....

diff -ur heimdal-0.0t-dist/appl/telnet/telnet/commands.c heimdal-0.0t/appl/telnet/telnet/commands.c
--- heimdal-0.0t-dist/appl/telnet/telnet/commands.c	Mon Jul 13 09:58:33 1998
+++ heimdal-0.0t/appl/telnet/telnet/commands.c	Sat Jan 23 19:20:34 1999
@@ -2138,8 +2138,10 @@
 	    hostname = _hostname;
 	} else {
 #ifdef HAVE_GETHOSTBYNAME2
+#ifdef HAVE_IPV6
 	    host = gethostbyname2(hostp, AF_INET6);
 	    if(host == NULL)
+#endif
 		host = gethostbyname2(hostp, AF_INET);
 #else
 	    host = roken_gethostbyname(hostp);
diff -ur heimdal-0.0t-dist/lib/krb5/changepw.c heimdal-0.0t/lib/krb5/changepw.c
--- heimdal-0.0t-dist/lib/krb5/changepw.c	Sat Nov 29 01:15:11 1997
+++ heimdal-0.0t/lib/krb5/changepw.c	Sat Jan 23 19:20:57 1999
@@ -65,8 +65,10 @@
 	*dot = '\0';
 
 #ifdef HAVE_GETHOSTBYNAME2
+#ifdef HAVE_IPV6
     hostent = gethostbyname2 (p, AF_INET6);
     if (hostent == NULL)
+#endif
 	hostent = gethostbyname2 (p, AF_INET);
 #else
     hostent = roken_gethostbyname (p);
diff -ur heimdal-0.0t-dist/lib/krb5/get_for_creds.c heimdal-0.0t/lib/krb5/get_for_creds.c
--- heimdal-0.0t-dist/lib/krb5/get_for_creds.c	Sat Jan 31 11:30:52 1998
+++ heimdal-0.0t/lib/krb5/get_for_creds.c	Sat Jan 23 19:20:58 1999
@@ -111,10 +111,12 @@
     addrs.val = NULL;
 
 #ifdef HAVE_GETHOSTBYNAME2
+#ifdef HAVE_IPV6
     ret = add_addrs (context, &addrs, gethostbyname2(hostname, AF_INET6),
 		     AF_INET6);
     if (ret)
 	return ret;
+#endif
     ret = add_addrs (context, &addrs, gethostbyname2(hostname, AF_INET),
 		     AF_INET);
     if (ret)
diff -ur heimdal-0.0t-dist/lib/krb5/send_to_kdc.c heimdal-0.0t/lib/krb5/send_to_kdc.c
--- heimdal-0.0t-dist/lib/krb5/send_to_kdc.c	Mon Jul 13 09:59:19 1998
+++ heimdal-0.0t/lib/krb5/send_to_kdc.c	Sat Jan 23 19:21:00 1999
@@ -263,8 +263,10 @@
 	     if (colon)
 		 *colon = '\0';
 #ifdef HAVE_GETHOSTBYNAME2
+#ifdef HAVE_IPV6
 	     hostent = gethostbyname2 (p, AF_INET6);
 	     if (hostent == NULL)
+#endif
 		 hostent = gethostbyname2 (p, AF_INET);
 #else
 	     hostent = roken_gethostbyname (p);