From b0b11b66e988857590d20cf377d4e7de9e8a0837 Mon Sep 17 00:00:00 2001 From: wpaul Date: Mon, 28 Jul 1997 14:13:57 +0000 Subject: Fix for PR #4147: apparently BIND now returns a status of NO_RECOVERY at the end of gethostanswer()/getanswer()/whatever where it used to return TRY_AGAIN. This breaks the domain list traversal in ypserv's async DNS lookup module: it would only retry using the domain(s) from the 'domain' or 'search' lines in /etc/resolv.conf if __dns_getanswer() returned TRY_AGAIN. Changed the test so that either TRY_AGAIN or NO_RECOVERY will work. This seemed to me the best solution in the event somebody tries to compile this code on an older system with a different version of BIND. (You shouldn't do that of course, but then there's a lot of things in the world that you shouldn't do and people do them anyway.) --- usr.sbin/ypserv/yp_dnslookup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.sbin/ypserv') diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c index e330e15..282bdcb 100644 --- a/usr.sbin/ypserv/yp_dnslookup.c +++ b/usr.sbin/ypserv/yp_dnslookup.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: yp_dnslookup.c,v 1.10 1997/02/22 16:15:10 peter Exp $ + * $Id: yp_dnslookup.c,v 1.11 1997/07/27 03:41:53 wpaul Exp $ */ /* @@ -65,7 +65,7 @@ #include "yp_extern.h" #ifndef lint -static const char rcsid[] = "$Id: yp_dnslookup.c,v 1.10 1997/02/22 16:15:10 peter Exp $"; +static const char rcsid[] = "$Id: yp_dnslookup.c,v 1.11 1997/07/27 03:41:53 wpaul Exp $"; #endif static char *parse(hp) @@ -390,7 +390,8 @@ void yp_run_dnsq() * query has failed. */ if (hent == NULL) { - if (h_errno == TRY_AGAIN && q->domain && *q->domain) { + 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) -- cgit v1.1