Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 482997498f9f95c2819169698d08f0c7 > files > 45

bind-9.3.6-25.P1.el5_11.8.src.rpm

diff -up bind-9.3.6-P1/bin/dig/dighost.c.rh469440 bind-9.3.6-P1/bin/dig/dighost.c
--- bind-9.3.6-P1/bin/dig/dighost.c.rh469440	2009-04-06 12:19:12.962003952 +0200
+++ bind-9.3.6-P1/bin/dig/dighost.c	2009-04-06 12:21:27.774003426 +0200
@@ -552,6 +552,11 @@ copy_server_list(lwres_conf_t *confdata,
 	for (i = 0; i < confdata->nsnext; i++) {
 		af = addr2af(confdata->nameservers[i].family);
 
+		if (af == AF_INET && !have_ipv4)
+			continue;
+		if (af == AF_INET6 && !have_ipv6)
+			continue;
+
 		lwres_net_ntop(af, confdata->nameservers[i].address,
 				   tmp, sizeof(tmp));
 		newsrv = make_server(tmp, tmp);
@@ -976,8 +981,10 @@ setup_system(void) {
 		debug("ndots is %d.", ndots);
 	}
 
+	copy_server_list(lwconf, &server_list);
+
 	/* If we don't find a nameserver fall back to localhost */
-	if (lwconf->nsnext == 0) {
+	if (ISC_LIST_EMPTY(server_list)) {
 		if (have_ipv4) {
 			lwresult = add_nameserver(lwconf, "127.0.0.1", AF_INET);
 			if (lwresult != ISC_R_SUCCESS)
@@ -988,10 +995,9 @@ setup_system(void) {
 			if (lwresult != ISC_R_SUCCESS)
 				fatal("add_nameserver failed");
 		}
-	}
 
-	if (ISC_LIST_EMPTY(server_list))
 		copy_server_list(lwconf, &server_list);
+	}
 
 	if (keyfile[0] != 0)
 		setup_file_key();