]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2786. [bug] Additional could be promoted to answer. [RT #20663]
authorMark Andrews <marka@isc.org>
Wed, 17 Nov 2010 10:21:02 +0000 (10:21 +0000)
committerMark Andrews <marka@isc.org>
Wed, 17 Nov 2010 10:21:02 +0000 (10:21 +0000)
CHANGES
bin/named/query.c
lib/dns/include/dns/db.h
lib/dns/rbtdb.c

diff --git a/CHANGES b/CHANGES
index 698b4b50d2c11f49972d8d33be803c4d02941191..8986e7c596ec15ee1a48d38246bc24b983495edd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -17,6 +17,8 @@
 2962.  [port]          win32: add more dependancies to BINDBuild.dsw.
                        [RT #22062]
 
+2786.  [bug]           Additional could be promoted to answer. [RT #20663]
+
        --- 9.4-ESV-R3 released ---
 
 2925.  [bug]           Named failed to accept uncachable negative responses
index 03f8c702be8c1677dd718c0a5a3f8198c082ac5d..5104558fdb8a8de5a3f3439aebf8e5816679384b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.257.18.55 2010/07/03 23:45:26 tbox Exp $ */
+/* $Id: query.c,v 1.257.18.56 2010/11/17 10:21:01 marka Exp $ */
 
 /*! \file */
 
@@ -1129,7 +1129,8 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
                        goto cleanup;
        }
        result = dns_db_find(db, name, version, type,
-                            client->query.dboptions | DNS_DBFIND_GLUEOK,
+                            client->query.dboptions |
+                            DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
                             client->now, &node, fname, rdataset,
                             sigrdataset);
        if (result == DNS_R_GLUE &&
@@ -1614,7 +1615,8 @@ query_addadditional2(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
                goto try_glue;
 
        result = dns_db_find(db, name, version, type,
-                            client->query.dboptions | DNS_DBFIND_GLUEOK,
+                            client->query.dboptions |
+                            DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
                             client->now, &node, fname, NULL, NULL);
        if (result == ISC_R_SUCCESS)
                goto found;
index 6086bff5f703fb75e7d323d57996413594951c66..1e7d5d2e149c6754f49b6f9f111d19248150cf9e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: db.h,v 1.76.18.14 2009/01/19 00:36:28 marka Exp $ */
+/* $Id: db.h,v 1.76.18.15 2010/11/17 10:21:02 marka Exp $ */
 
 #ifndef DNS_DB_H
 #define DNS_DB_H 1
@@ -184,13 +184,15 @@ struct dns_db {
 /*%
  * Options that can be specified for dns_db_find().
  */
-#define DNS_DBFIND_GLUEOK              0x01
-#define DNS_DBFIND_VALIDATEGLUE                0x02
-#define DNS_DBFIND_NOWILD              0x04
-#define DNS_DBFIND_PENDINGOK           0x08
-#define DNS_DBFIND_NOEXACT             0x10
-#define DNS_DBFIND_FORCENSEC           0x20
-#define DNS_DBFIND_COVERINGNSEC                0x40
+#define DNS_DBFIND_GLUEOK              0x0001
+#define DNS_DBFIND_VALIDATEGLUE                0x0002
+#define DNS_DBFIND_NOWILD              0x0004
+#define DNS_DBFIND_PENDINGOK           0x0008
+#define DNS_DBFIND_NOEXACT             0x0010
+#define DNS_DBFIND_FORCENSEC           0x0020
+#define DNS_DBFIND_COVERINGNSEC                0x0040
+#define DNS_DBFIND_FORCENSEC3          0x0080
+#define DNS_DBFIND_ADDITIONALOK                0x0100
 /*@}*/
 
 /*@{*/
@@ -649,6 +651,10 @@ dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
  *     For cache databases, glue is any rdataset with a trust of
  *     dns_trust_glue.
  *
+ * \li If 'options' does not have #DNS_DBFIND_ADDITIONALOK set, then no
+ *     additional records will be returned.  Only caches can have 
+ *     rdataset with trust dns_trust_additional.
+ *
  * \li If 'options' does not have #DNS_DBFIND_PENDINGOK set, then no
  *     pending data will be returned.  This option is only meaningful for
  *     cache databases.
index 95b2385b58602103cc38a4d701670c1e09c1fce5..0aafb9ffb14f3e4a5896696dbb85188fc4755c19 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.196.18.63 2010/11/16 23:45:24 tbox Exp $ */
+/* $Id: rbtdb.c,v 1.196.18.64 2010/11/17 10:21:01 marka Exp $ */
 
 /*! \file */
 
@@ -3594,6 +3594,8 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
         * If we didn't find what we were looking for...
         */
        if (found == NULL ||
+           (found->trust == dns_trust_additional &&
+            ((options & DNS_DBFIND_ADDITIONALOK) == 0)) ||
            (found->trust == dns_trust_glue &&
             ((options & DNS_DBFIND_GLUEOK) == 0)) ||
            (DNS_TRUST_PENDING(found->trust) &&