about summary refs log tree commit diff
path: root/resolv
diff options
context:
space:
mode:
Diffstat (limited to 'resolv')
-rw-r--r--resolv/res_init.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 2d2459d5a3..893072f24e 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -207,13 +207,12 @@ res_init()
 #ifdef USELOOPBACK
 	_res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
 	_res.nscount = 1;
-	_res.nsaddr.sin_port = htons(NAMESERVER_PORT);
 #else
 	_res.nsaddr.sin_addr.s_addr = INADDR_ANY;
 	_res.nscount = 0;
-	_res.nsaddr.sin_port = 0;
 #endif
 	_res.nsaddr.sin_family = AF_INET;
+	_res.nsaddr.sin_port = htons(NAMESERVER_PORT);
 	_res.ndots = 1;
 	_res.pfcode = 0;
 
@@ -380,7 +379,7 @@ res_init()
 		    continue;
 		}
 	    }
-	    if (nserv > 1)
+	    if (nserv > _res.nscount)
 		_res.nscount = nserv;
 #ifdef RESOLVSORT
 	    _res.nsort = nsort;
@@ -573,7 +572,7 @@ netinfo_res_init(haveenv, havesearch)
 		    ni_namelist_free(&nl);
 		}
 
-		if (nserv > 1)
+		if (nserv > _res.nscount)
 		    _res.nscount = nserv;
 
 #ifdef RESOLVSORT