]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3081. [bug] Failure of DNAME substitution did not return
authorMark Andrews <marka@isc.org>
Sat, 19 Mar 2011 09:47:54 +0000 (09:47 +0000)
committerMark Andrews <marka@isc.org>
Sat, 19 Mar 2011 09:47:54 +0000 (09:47 +0000)
                        YXDOMAIN. [RT #23591]

bin/named/query.c

index 1d9575cda8f0616183d8dd47e7714752a4cd7eff..af71dff9c96232aa8e4c0899cb5ee6744ac47051 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.313.20.26 2011/03/12 04:57:23 tbox Exp $ */
+/* $Id: query.c,v 1.313.20.27 2011/03/19 09:47:54 marka Exp $ */
 
 /*! \file */
 
@@ -4584,18 +4584,19 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                        goto cleanup;
                }
                result = dns_name_concatenate(prefix, tname, fname, NULL);
+
+               /*
+                * RFC2672, section 4.1, subsection 3c says
+                * we should return YXDOMAIN if the constructed
+                * name would be too long.
+                */
+               if (result == DNS_R_NAMETOOLONG)
+                       client->message->rcode = dns_rcode_yxdomain;
                if (result != ISC_R_SUCCESS) {
                        dns_message_puttempname(client->message, &tname);
-                       if (result == ISC_R_NOSPACE) {
-                               /*
-                                * RFC2672, section 4.1, subsection 3c says
-                                * we should return YXDOMAIN if the constructed
-                                * name would be too long.
-                                */
-                               client->message->rcode = dns_rcode_yxdomain;
-                       }
                        goto cleanup;
                }
+
                query_keepname(client, fname, dbuf);
                /*
                 * Synthesize a CNAME for this DNAME.