mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Missing server address again leads to localhost being used
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2010-08-25 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #10851]
|
||||||
|
* resolv/res_init.c (__res_vinit): When no server address at all
|
||||||
|
is given default to loopback.
|
||||||
|
|
||||||
2010-08-24 Roland McGrath <roland@redhat.com>
|
2010-08-24 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* configure.in: Remove config-name.h generation.
|
* configure.in: Remove config-name.h generation.
|
||||||
|
@ -176,13 +176,6 @@ __res_vinit(res_state statp, int preinit) {
|
|||||||
statp->id = res_randomid();
|
statp->id = res_randomid();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USELOOPBACK
|
|
||||||
statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
|
|
||||||
#else
|
|
||||||
statp->nsaddr.sin_addr.s_addr = INADDR_ANY;
|
|
||||||
#endif
|
|
||||||
statp->nsaddr.sin_family = AF_INET;
|
|
||||||
statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
|
|
||||||
statp->nscount = 0;
|
statp->nscount = 0;
|
||||||
statp->ndots = 1;
|
statp->ndots = 1;
|
||||||
statp->pfcode = 0;
|
statp->pfcode = 0;
|
||||||
@ -433,6 +426,11 @@ __res_vinit(res_state statp, int preinit) {
|
|||||||
#endif
|
#endif
|
||||||
(void) fclose(fp);
|
(void) fclose(fp);
|
||||||
}
|
}
|
||||||
|
if (__builtin_expect(statp->nscount == 0, 0)) {
|
||||||
|
statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
|
||||||
|
statp->nsaddr.sin_family = AF_INET;
|
||||||
|
statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
|
||||||
|
}
|
||||||
if (statp->defdname[0] == 0 &&
|
if (statp->defdname[0] == 0 &&
|
||||||
__gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
|
__gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
|
||||||
(cp = strchr(buf, '.')) != NULL)
|
(cp = strchr(buf, '.')) != NULL)
|
||||||
|
Reference in New Issue
Block a user