]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2593. [bug] Improve a corner source of SERVFAILs [RT #19632]
authorMark Andrews <marka@isc.org>
Thu, 3 Dec 2009 04:38:28 +0000 (04:38 +0000)
committerMark Andrews <marka@isc.org>
Thu, 3 Dec 2009 04:38:28 +0000 (04:38 +0000)
CHANGES
bin/named/query.c

diff --git a/CHANGES b/CHANGES
index d24d3f7790cb2a29c2cd83a0ee78c3144b92dfc2..121ada4946d049a0426d75cc27542ecd8185ca66 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 2601.  [doc]           Mention file creation mode mask in the
                        named manual page.
 
+2593.  [bug]           Improve a corner source of SERVFAILs [RT #19632]
+
 2589.  [bug]           dns_db_unregister() failed to clear '*dbimp'.
                        [RT #19626]
 
index a35ec1784f64b4a5f8f41647abdee0002fd378be..4877d8fcb6d27ac9e2748cf1ec8ba6dcc254144f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.313.20.14 2009/11/25 02:25:56 marka Exp $ */
+/* $Id: query.c,v 1.313.20.15 2009/12/03 04:38:28 marka Exp $ */
 
 /*! \file */
 
@@ -3318,6 +3318,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.
@@ -4042,14 +4050,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. */
@@ -4228,11 +4230,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;
 
@@ -4772,7 +4771,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;
                                }
                                /*