4534. [bug] Only set RD, RA and CD in QUERY responses. [RT #43879]

(cherry picked from commit def6b33bad)
This commit is contained in:
Mark Andrews
2016-12-13 16:27:18 +11:00
parent 25725d525d
commit bcdf316ca5
3 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
4534. [bug] Only set RD, RA and CD in QUERY responses. [RT #43879]
4533. [bug] dns_client_update should terminate on prerequisite
failures (NXDOMAIN, YXDOMAIN, NXRRSET, YXRRSET)
and also on BADZONE. [RT #43865]

View File

@@ -938,7 +938,8 @@ ns_client_send(ns_client_t *client) {
CTRACE("send");
if ((client->attributes & NS_CLIENTATTR_RA) != 0)
if (client->message->opcode == dns_opcode_query &&
(client->attributes & NS_CLIENTATTR_RA) != 0)
client->message->flags |= DNS_MESSAGEFLAG_RA;
if ((client->attributes & NS_CLIENTATTR_WANTDNSSEC) != 0)

View File

@@ -2593,7 +2593,10 @@ dns_message_reply(dns_message_t *msg, isc_boolean_t want_question_section) {
* We now clear most flags and then set QR, ensuring that the
* reply's flags will be in a reasonable state.
*/
msg->flags &= DNS_MESSAGE_REPLYPRESERVE;
if (msg->opcode == dns_opcode_query)
msg->flags &= DNS_MESSAGE_REPLYPRESERVE;
else
msg->flags = 0;
msg->flags |= DNS_MESSAGEFLAG_QR;
/*