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

diff --git a/CHANGES b/CHANGES
index 1be15171d2851b54aac11592e20c1d0e409ec536..2c92d268a4e3924baae69f0173c1916d3c544c34 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2786.  [bug]           Additional could be promoted to answer. [RT #20663]
+
 2784.  [bug]           TC was not always being set when required glue was
                        dropped. [RT #20655]
 
index 6a69a099a36b00358a50c23ab6438b37f8fa1534..66db8040ecd07ab2adb756940a9279addf38fd13 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.298.48.18 2009/11/24 03:15:54 marka Exp $ */
+/* $Id: query.c,v 1.298.48.19 2009/11/25 02:32:05 marka Exp $ */
 
 /*! \file */
 
@@ -1143,7 +1143,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 &&
@@ -1628,7 +1629,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 32fa836b5ff3aa1f0ce6971b33a9a60156c8235c..6ac606c0c686c53808b4f88dae74d97938790983 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: db.h,v 1.89.128.5 2009/01/19 00:01:11 marka Exp $ */
+/* $Id: db.h,v 1.89.128.6 2009/11/25 02:32:05 marka Exp $ */
 
 #ifndef DNS_DB_H
 #define DNS_DB_H 1
@@ -187,13 +187,17 @@ 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
+#if 0
+#define DNS_DBFIND_FORCENSEC3          0x0080  /* BIND 9.6.0 and later. */
+#endif
+#define DNS_DBFIND_ADDITIONALOK                0x0100
 /*@}*/
 
 /*@{*/
@@ -652,6 +656,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 a324126ef17ffa787360664a1a8b468a687b8f08..4ad10881a50c801ce664e16a6f6d4f07a645b01d 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.248.12.19 2009/11/18 00:08:59 marka Exp $ */
+/* $Id: rbtdb.c,v 1.248.12.20 2009/11/25 02:32:05 marka Exp $ */
 
 /*! \file */
 
@@ -4106,6 +4106,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) &&