]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2290. [bug] Let AD in the query signal that the client wants AD
authorMark Andrews <marka@isc.org>
Wed, 9 Jan 2008 04:09:12 +0000 (04:09 +0000)
committerMark Andrews <marka@isc.org>
Wed, 9 Jan 2008 04:09:12 +0000 (04:09 +0000)
                        set in the response. [RT #17301]

CHANGES
bin/named/query.c

diff --git a/CHANGES b/CHANGES
index 642669f4ff7a685b8ac8ae48de17f6d23cb2b806..6cabbd86d74abfdb74e222f30d663f8ff2ee9960 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2290.  [bug]           Let AD in the query signal that the client wants AD
+                       set in the response. [RT #17301]
+
 2289.  [func]          named-checkzone now reports the out-of-zone CNAME
                        found. [RT #17309]
 
index b2a95feaf972cc34f7810a04d5338eeaac72df25..e82729731bdc9a87bdb97aaf062d2dc4c6d7e5d7 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.300 2008/01/02 23:47:01 tbox Exp $ */
+/* $Id: query.c,v 1.301 2008/01/09 04:09:12 marka Exp $ */
 
 /*! \file */
 
@@ -4442,6 +4442,7 @@ ns_query_start(ns_client_t *client) {
        dns_rdatatype_t qtype;
        unsigned int saved_extflags = client->extflags;
        unsigned int saved_flags = client->message->flags;
+       isc_boolean_t want_ad;
 
        CTRACE("ns_query_start");
 
@@ -4586,6 +4587,15 @@ ns_query_start(ns_client_t *client) {
        if (message->flags & DNS_MESSAGEFLAG_CD)
                client->query.attributes &= ~NS_QUERYATTR_SECURE;
 
+       /*
+        * Set 'want_ad' if the client has set AD in the query.
+        * This allows AD to be returned on queries without DO set.
+        */
+       if ((message->flags & DNS_MESSAGEFLAG_AD) != 0)
+               want_ad = ISC_TRUE;
+       else
+               want_ad = ISC_FALSE;
+
        /*
         * This is an ordinary query.
         */
@@ -4605,7 +4615,7 @@ ns_query_start(ns_client_t *client) {
         * Set AD.  We must clear it if we add non-validated data to a
         * response.
         */
-       if (WANTDNSSEC(client))
+       if (WANTDNSSEC(client) || want_ad)
                message->flags |= DNS_MESSAGEFLAG_AD;
 
        qclient = NULL;