]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Tue, 20 Feb 2001 21:56:25 +0000 (21:56 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 20 Feb 2001 21:56:25 +0000 (21:56 +0000)
744. [bug]
When returning DNS_R_CNAME or DNS_R_DNAME as the result of an ANY or SIG
query, the resolver failed to setup the return event's rdatasets, causing an
assertion failure in the query code.  [RT #881]

The fix includes the addition of the DNS_NAMEATTR_CHAINING attribute,
and the removal of the DNS_NAMEATTR_CNAME and DNS_NAMEATTR_DNAME attributes,
because they were not used anywhere in the current source.

CHANGES
lib/dns/include/dns/name.h
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 1090dee4a80e36d60acfaca4bf88d9ffb6867595..bb9d721f2c5a96f7971c3b4330e4d695e38287ed 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
 
+ 744.  [bug]           When returning DNS_R_CNAME or DNS_R_DNAME as the
+                       result of an ANY or SIG query, the resolver failed
+                       to setup the return event's rdatasets, causing an
+                       assertion failure in the query code.  [RT #881]
+
  743.  [bug]           Receiving a large number of certain malformed
                        answers could cause named to stop responding.
                        [RT #861]
index e1023bbc1d126dea7c4095949049b58dffc59f9d..3c4896e184282f61e88907be49cc7367b89ef001 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: name.h,v 1.83.2.2 2001/01/22 18:23:12 gson Exp $ */
+/* $Id: name.h,v 1.83.2.3 2001/02/20 21:56:25 gson Exp $ */
 
 #ifndef DNS_NAME_H
 #define DNS_NAME_H 1
@@ -207,8 +207,7 @@ struct dns_name {
 #define DNS_NAMEATTR_CACHE             0x0100          /* Used by resolver. */
 #define DNS_NAMEATTR_ANSWER            0x0200          /* Used by resolver. */
 #define DNS_NAMEATTR_NCACHE            0x0400          /* Used by resolver. */
-#define DNS_NAMEATTR_CNAME             0x0800          /* Used by message. */
-#define DNS_NAMEATTR_DNAME             0x1000          /* Used by message. */
+#define DNS_NAMEATTR_CHAINING          0x0800          /* Used by resolver. */
 
 extern dns_name_t *dns_rootname;
 extern dns_name_t *dns_wildcardname;
index 729fc9c82d0718ccaae2d0b1d58a4d37d87825d9..02d77f79eb6b92391b950f2ff8b9f48ef73a885e 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.187.2.6 2001/02/17 02:27:42 bwelling Exp $ */
+/* $Id: resolver.c,v 1.187.2.7 2001/02/20 21:56:23 gson Exp $ */
 
 #include <config.h>
 
@@ -2645,8 +2645,16 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
                        if (result != ISC_R_SUCCESS)
                                return (result);
                        anodep = &event->node;
-                       if (fctx->type != dns_rdatatype_any &&
-                           fctx->type != dns_rdatatype_sig) {
+                       /*
+                        * If this is an ANY or SIG query, we're not going
+                        * to return any rdatasets, unless we encountered
+                        * a CNAME or DNAME as "the answer".  In this case,
+                        * we're going to return DNS_R_CNAME or DNS_R_DNAME
+                        * and we must set up the rdatasets.
+                        */
+                       if ((fctx->type != dns_rdatatype_any &&
+                           fctx->type != dns_rdatatype_sig) ||
+                           (name->attributes & DNS_NAMEATTR_CHAINING) != 0) {
                                ardataset = event->rdataset;
                                asigrdataset = event->sigrdataset;
                        }
@@ -3668,6 +3676,8 @@ answer_response(fetchctx_t *fctx) {
                                         */
                                        if (want_chaining) {
                                                chaining = ISC_TRUE;
+                                               name->attributes |=
+                                                       DNS_NAMEATTR_CHAINING;
                                                rdataset->attributes |=
                                                    DNS_RDATASETATTR_CHAINING;
                                                qname = &tname;
@@ -3780,6 +3790,8 @@ answer_response(fetchctx_t *fctx) {
                                                if (result != ISC_R_SUCCESS)
                                                        return (result);
                                                chaining = ISC_TRUE;
+                                               name->attributes |=
+                                                       DNS_NAMEATTR_CHAINING;
                                                rdataset->attributes |=
                                                    DNS_RDATASETATTR_CHAINING;
                                                qname = dns_fixedname_name(