+ 753. [bug] dig, host, and nslookup would fail to contact a
+ remote server if getaddrinfo() returned an IPv6
+ address on a system that doesn't support IPv6.
+
752. [func] Correct bad tv_usec elements returned by gettimeofday().
751. [func] Log successful zone loads / transfers.
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dighost.c,v 1.193 2001/02/17 01:05:29 gson Exp $ */
+/* $Id: dighost.c,v 1.194 2001/02/24 20:53:26 bwelling Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
struct in_addr in4;
struct in6_addr in6;
#ifdef USE_GETADDRINFO
- struct addrinfo *res = NULL;
+ struct addrinfo *res = NULL, hints;
int result;
#else
struct hostent *he;
isc_sockaddr_fromin(sockaddr, &in4, port);
else {
#ifdef USE_GETADDRINFO
+ memset(&hints, 0, sizeof(hints));
+ if (!have_ipv6)
+ hints.ai_family = PF_INET;
+ else if (!have_ipv4)
+ hints.ai_family = PF_INET6;
+ else
+ hints.ai_family = PF_UNSPEC;
debug ("before getaddrinfo()");
isc_app_block();
- result = getaddrinfo(host, NULL, NULL, &res);
+ result = getaddrinfo(host, NULL, &hints, &res);
isc_app_unblock();
if (result != 0) {
fatal("Couldn't find server '%s': %s",