1999-03-07 Mark Kettenis <kettenis@gnu.org>
[kopensolaris-gnu/glibc.git] / resolv / res_init.c
index 2d2459d..893072f 100644 (file)
@@ -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