unlink from namelist before calling dns_message_addname

(cherry picked from commit 8244b5c296cd2f4d3c90af969d79bf4c4d3f8ead)
This commit is contained in:
Mark Andrews
2013-02-18 16:01:50 +11:00
parent 98cc9f6ead
commit 12a3b0a480

View File

@@ -974,8 +974,13 @@ dns_tkey_builddhquery(dns_message_t *msg, dst_key_t *key, dns_name_t *name,
ISC_LIST_INIT(namelist);
RETERR(add_rdata_to_list(msg, &keyname, rdata, 0, &namelist));
dns_message_addname(msg, ISC_LIST_HEAD(namelist),
DNS_SECTION_ADDITIONAL);
name = ISC_LIST_HEAD(namelist);
while (name != NULL) {
dns_name_t *next = ISC_LIST_NEXT(name, link);
ISC_LIST_UNLINK(namelist, name, link);
dns_message_addname(msg, name, DNS_SECTION_ADDITIONAL);
name = next;
}
return (ISC_R_SUCCESS);