diff options
Diffstat (limited to 'resolv/res_init.c')
-rw-r--r-- | resolv/res_init.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/resolv/res_init.c b/resolv/res_init.c index a2840968f3..2bf830cc95 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 = 1; + statp->nscount = 0; statp->ndots = 1; statp->pfcode = 0; statp->_vcsock = -1; @@ -314,9 +314,9 @@ __res_vinit(res_state statp, int preinit) { cp++; if ((*cp != '\0') && (*cp != '\n') && __inet_aton(cp, &a)) { - statp->nsaddr_list[nserv].sin_addr = a; - statp->nsaddr_list[nserv].sin_family = AF_INET; - statp->nsaddr_list[nserv].sin_port = + statp->nsaddr_list[nservall].sin_addr = a; + statp->nsaddr_list[nservall].sin_family = AF_INET; + statp->nsaddr_list[nservall].sin_port = htons(NAMESERVER_PORT); nserv++; #ifdef _LIBC @@ -420,8 +420,7 @@ __res_vinit(res_state statp, int preinit) { continue; } } - if (nserv > 1) - statp->nscount = nserv; + statp->nscount = nservall; #ifdef _LIBC if (nservall - nserv > 0) { statp->_u._ext.nscount6 = nservall - nserv; |