]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Improve a corner source of SERVFAILs [RT #19632]
authorFrancis Dupont <fdupont@isc.org>
Thu, 30 Apr 2009 11:45:10 +0000 (11:45 +0000)
committerFrancis Dupont <fdupont@isc.org>
Thu, 30 Apr 2009 11:45:10 +0000 (11:45 +0000)
CHANGES
bin/named/query.c

diff --git a/CHANGES b/CHANGES
index ffb34e37c4bd2a591e69d20ba762324c52d56333..e37afbbe1e6c2f96a5fbc4c13f7e52c47ff32b58 100644 (file)
--- 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
index b0c74d340143944ebcf6885a22dba52c961e2cbb..98f4bf000b1c72f350153b8ac7da55f9ebae0a33 100644 (file)
@@ -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;
                                }
                                /*