Sophie

Sophie

distrib > Mandriva > 2010.2 > x86_64 > by-pkgid > e0ecf1de97625bd665ba6741f8b282d6 > files > 39

glibc-2.11.1-8mnb2.src.rpm

 2009-11-20  Petr Baudis <pasky@suse.cz>

	[BZ #10851]
	* resolv/res_init.c (__res_vinit): Initialize nscount again to
	one so that the default localhost nameserver record is used.

diff --git a/resolv/res_init.c b/resolv/res_init.c
index 40dbe7d..99ef8cf 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -183,7 +183,7 @@ __res_vinit(res_state statp, int preinit) {
 #endif
 	statp->nsaddr.sin_family = AF_INET;
 	statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
-	statp->nscount = 0;
+	statp->nscount = 1;
 	statp->ndots = 1;
 	statp->pfcode = 0;
 	statp->_vcsock = -1;
@@ -420,7 +420,8 @@ __res_vinit(res_state statp, int preinit) {
 		    continue;
 		}
 	    }
-	    statp->nscount = nservall;
+	    if (nservall > 0)
+	      statp->nscount = nservall;
 #ifdef _LIBC
 	    if (nservall - nserv > 0) {
 		statp->_u._ext.nscount6 = nservall - nserv;