From 2678fccde3453facce53f857d95fec30ca4a284f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 9 Jan 2008 04:09:12 +0000 Subject: [PATCH] 2290. [bug] Let AD in the query signal that the client wants AD set in the response. [RT #17301] --- CHANGES | 3 +++ bin/named/query.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 642669f4ff..6cabbd86d7 100644 --- 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] diff --git a/bin/named/query.c b/bin/named/query.c index b2a95feaf9..e82729731b 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -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;