in the case of queries answered from the cache.
[RT #1436]
+ 995. [bug] dig, host, nslookup: using a raw IPv6 address as a
+ target address should be fatal on a IPv4 only system.
+
--- 9.2.0 released ---
1134. [bug] Multithreaded servers could deadlock in ferror()
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dighost.c,v 1.221.2.8 2001/11/28 23:29:13 gson Exp $ */
+/* $Id: dighost.c,v 1.221.2.9 2002/01/24 18:42:29 gson Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
debug("get_address()");
- /*
- * Assume we have v4 if we don't have v6, since setup_libs
- * fatal()'s out if we don't have either.
- */
- if (have_ipv6 && inet_pton(AF_INET6, host, &in6) == 1)
+ if (inet_pton(AF_INET6, host, &in6) == 1) {
+ if (!have_ipv6)
+ fatal("Protocol family INET6 not supported '%s'", host);
isc_sockaddr_fromin6(sockaddr, &in6, port);
- else if (inet_pton(AF_INET, host, &in4) == 1)
- isc_sockaddr_fromin(sockaddr, &in4, port);
- else {
+ } else if (inet_pton(AF_INET, host, &in4) == 1) {
+ if (have_ipv4)
+ isc_sockaddr_fromin(sockaddr, &in4, port);
+ else
+ isc_sockaddr_v6fromin(sockaddr, &in4, port);
+ } else {
#ifdef USE_GETADDRINFO
memset(&hints, 0, sizeof(hints));
if (!have_ipv6)