SHA256
3
0
forked from pool/glibc
glibc/glibc-nameserver-localhost.diff
OBS User autobuild e29cecdd47 Accepting request 27940 from Base:System
Copy from Base:System/glibc based on submit request 27940 from user dirkmueller

OBS-URL: https://build.opensuse.org/request/show/27940
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=14
2010-01-03 11:31:34 +00:00

30 lines
860 B
Diff

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;