diff --git a/CHANGES b/CHANGES index ffb34e37c4..e37afbbe1e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +2593. [bug] Improve a corner source of SERVFAILs [RT #19632] + 2592. [bug] Treat "any" as a type in nsupdate. [RT #19455] 2591. [bug] named could die when processing a update in diff --git a/bin/named/query.c b/bin/named/query.c index b0c74d3401..98f4bf000b 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.322 2009/03/13 01:35:18 marka Exp $ */ +/* $Id: query.c,v 1.323 2009/04/30 11:45:10 fdupont Exp $ */ /*! \file */ @@ -3321,6 +3321,14 @@ do { \ line = __LINE__; \ } while (0) +#define RECURSE_ERROR(r) \ +do { \ + if ((r) == DNS_R_DUPLICATE || (r) == DNS_R_DROP) \ + QUERY_ERROR(r); \ + else \ + QUERY_ERROR(DNS_R_SERVFAIL); \ +} while (0) + /* * Extract a network address from the RDATA of an A or AAAA * record. @@ -4003,14 +4011,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) if (result == ISC_R_SUCCESS) client->query.attributes |= NS_QUERYATTR_RECURSING; - else if (result == DNS_R_DUPLICATE || - result == DNS_R_DROP) { - /* Duplicate query. */ - QUERY_ERROR(result); - } else { - /* Unable to recurse. */ - QUERY_ERROR(DNS_R_SERVFAIL); - } + else + RECURSE_ERROR(result); goto cleanup; } else { /* Unable to give root server referral. */ @@ -4189,11 +4191,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) if (result == ISC_R_SUCCESS) client->query.attributes |= NS_QUERYATTR_RECURSING; - else if (result == DNS_R_DUPLICATE || - result == DNS_R_DROP) - QUERY_ERROR(result); else - QUERY_ERROR(DNS_R_SERVFAIL); + RECURSE_ERROR(result); } else { dns_fixedname_t fixed; @@ -4733,7 +4732,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) client->query.attributes |= NS_QUERYATTR_RECURSING; else - QUERY_ERROR(DNS_R_SERVFAIL); } + RECURSE_ERROR(result); + } goto addauth; } /*