When res_send() fails, we should reserve an error code.

This commit is contained in:
ume 2006-03-24 04:49:30 +00:00
parent eb9bdb4259
commit 6d9b77bdc9

View File

@ -2358,9 +2358,9 @@ res_queryN(name, target, res)
}
#endif
if (n < 0 || n > anslen)
if (n > anslen)
hp->rcode = FORMERR; /* XXX not very informative */
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)