From 6a7b5eb0f2541ec102832f30f6c61d28e195fc98 Mon Sep 17 00:00:00 2001 From: itojun Date: Thu, 16 Mar 2000 14:08:55 +0000 Subject: [PATCH] workaround against name servers which return NXDOMAIN/SERVFAIL on IPv4 only node (the srever server should return acount = 0 without error). NetBSD PR: 9621 --- lib/libc/net/getaddrinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 1038ce9d83e..8de6394a10e 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.16 2000/03/13 12:26:56 itojun Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.17 2000/03/16 14:08:55 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -1545,6 +1545,7 @@ res_queryN(name, target) return (n); } n = res_send(buf, n, answer, anslen); +#if 0 if (n < 0) { #ifdef DEBUG if (_res.options & RES_DEBUG) @@ -1553,8 +1554,9 @@ res_queryN(name, target) h_errno = TRY_AGAIN; return (n); } +#endif - if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { + if (n < 0 || hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { rcode = hp->rcode; /* record most recent error */ #ifdef DEBUG if (_res.options & RES_DEBUG) -- 2.20.1