diff options
author | markm <markm@FreeBSD.org> | 2002-09-20 20:09:27 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-09-20 20:09:27 +0000 |
commit | f49cc792fa5d17dbf8150e52c9a16284a12bc2c2 (patch) | |
tree | 5e40d2ae3f6efab0bd16530aaf097fc58857b16e /usr.sbin/ypserv | |
parent | 7214c4fb56bee656ed7b10c3665d900f797eb245 (diff) | |
download | FreeBSD-src-f49cc792fa5d17dbf8150e52c9a16284a12bc2c2.zip FreeBSD-src-f49cc792fa5d17dbf8150e52c9a16284a12bc2c2.tar.gz |
The resolver library does a pretty acceptable set of domain
suffix attempts before failing. No need to try again by hand,
particularly when it fills your log with failures because
localhost.example.com..example.com fails to resolve. Also improve the
log message that helped find this error.
There is still (maybe) an uninitialised pointer problem here, but in a
month of testing I haven't triggered it.
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r-- | usr.sbin/ypserv/yp_dnslookup.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c index 016cbb0c..02cdfcf4 100644 --- a/usr.sbin/ypserv/yp_dnslookup.c +++ b/usr.sbin/ypserv/yp_dnslookup.c @@ -176,7 +176,7 @@ yp_send_dns_query(char *name, int type) n = res_mkquery(QUERY,name,C_IN,type,NULL,0,NULL,buf,sizeof(buf)); if (n <= 0) { - yp_error("res_mkquery failed"); + yp_error("res_mkquery failed for %s type %d", name, type); return(0); } @@ -386,24 +386,7 @@ yp_run_dnsq(void) hent = __dns_getanswer(buf, rval, q->name, q->type); - /* - * If the lookup failed, try appending one of the domains - * from resolv.conf. If we have no domains to test, the - * query has failed. - */ - if (hent == NULL) { - if ((h_errno == TRY_AGAIN || h_errno == NO_RECOVERY) - && q->domain && *q->domain) { - snprintf(retrybuf, sizeof(retrybuf), "%s.%s", - q->name, *q->domain); - if (debug) - yp_error("retrying with: %s", retrybuf); - q->id = yp_send_dns_query(retrybuf, q->type); - q->ttl = DEF_TTL; - q->domain++; - return; - } - } else { + if (hent != NULL) { if (q->type == T_PTR) { hent->h_addr = (char *)&q->addr.s_addr; hent->h_length = sizeof(struct in_addr); |