2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 06:55:30 +00:00

fixes to dns_message_sectiontotext for the question section

This commit is contained in:
Brian Wellington
2000-05-20 02:00:29 +00:00
parent 19591ace46
commit d1eee46938

View File

@@ -2390,6 +2390,7 @@ dns_message_checksig(dns_message_t *msg, dns_view_t *view) {
result = DNS_R_KEYUNAUTHORIZED; result = DNS_R_KEYUNAUTHORIZED;
freesig: freesig:
if (dns_rdataset_isassociated(&keyset))
dns_rdataset_disassociate(&keyset); dns_rdataset_disassociate(&keyset);
dns_rdata_freestruct(&sig); dns_rdata_freestruct(&sig);
return (result); return (result);
@@ -2404,11 +2405,17 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
dns_name_t *name, empty_name; dns_name_t *name, empty_name;
dns_rdataset_t *rdataset; dns_rdataset_t *rdataset;
isc_result_t result; isc_result_t result;
isc_boolean_t no_rdata;
REQUIRE(DNS_MESSAGE_VALID(msg)); REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(VALID_SECTION(section)); REQUIRE(VALID_SECTION(section));
if (section == DNS_SECTION_QUESTION)
no_rdata = ISC_TRUE;
else
no_rdata = ISC_FALSE;
if (comments) { if (comments) {
ADD_STRING(target, ";; "); ADD_STRING(target, ";; ");
ADD_STRING(target, sectiontext[section]); ADD_STRING(target, sectiontext[section]);
@@ -2426,18 +2433,15 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
for (rdataset = ISC_LIST_HEAD(name->list); for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL; rdataset != NULL;
rdataset = ISC_LIST_NEXT(rdataset, link)) { rdataset = ISC_LIST_NEXT(rdataset, link)) {
result = dns_rdataset_first(rdataset); if (no_rdata)
if (result != ISC_R_NOMORE) { ADD_STRING(target, ";");
if (result != ISC_R_SUCCESS)
return(result);
result = dns_rdataset_totext(rdataset, name, result = dns_rdataset_totext(rdataset, name,
omit_final_dot, omit_final_dot,
ISC_FALSE, no_rdata,
target); target);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);
} }
}
result = dns_message_nextname(msg, section); result = dns_message_nextname(msg, section);
} while (result == ISC_R_SUCCESS); } while (result == ISC_R_SUCCESS);
if (result == ISC_R_NOMORE) if (result == ISC_R_NOMORE)