2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

tweaks to dns_message_reply()

This commit is contained in:
Bob Halley
1999-07-29 01:26:53 +00:00
parent 5debbf1189
commit a6ebd71eed
2 changed files with 18 additions and 10 deletions

View File

@@ -1605,10 +1605,13 @@ dns_message_reply(dns_message_t *msg, isc_boolean_t want_question_section) {
if (!msg->header_ok)
return (DNS_R_FORMERR);
if (want_question_section && msg->question_ok)
if (msg->opcode != dns_opcode_query)
want_question_section = ISC_FALSE;
if (want_question_section) {
if (!msg->question_ok)
return (DNS_R_FORMERR);
first_section = DNS_SECTION_ANSWER;
else
} else
first_section = DNS_SECTION_QUESTION;
msg->from_to_wire = DNS_MESSAGE_INTENTRENDER;
msgresetnames(msg, first_section);