Commit 004da171 authored by Bob Halley's avatar Bob Halley
Browse files

Make the public version of findname() set attributes appropriately.

parent 71637c64
...@@ -1566,6 +1566,8 @@ dns_message_findname(dns_message_t *msg, dns_section_t section, ...@@ -1566,6 +1566,8 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
{ {
dns_name_t *foundname; dns_name_t *foundname;
dns_result_t result; dns_result_t result;
unsigned int attributes;
dns_rdatatype_t atype;
/* /*
* XXX These requirements are probably too intensive, especially * XXX These requirements are probably too intensive, especially
...@@ -1585,13 +1587,24 @@ dns_message_findname(dns_message_t *msg, dns_section_t section, ...@@ -1585,13 +1587,24 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
REQUIRE(*rdataset == NULL); REQUIRE(*rdataset == NULL);
} }
/*
* Figure out what attributes we should look for.
*/
if (type == dns_rdatatype_sig)
atype = covers;
else
atype = type;
attributes = 0;
if (atype == dns_rdatatype_cname)
attributes = DNS_NAMEATTR_CNAME;
else if (atype == dns_rdatatype_cname)
attributes = DNS_NAMEATTR_DNAME;
/* /*
* Search through, looking for the name. * Search through, looking for the name.
*
* XXXRTH We should probably allow the 'attributes' parameter
* to be set in the public API.
*/ */
result = findname(&foundname, target, 0, &msg->sections[section]); result = findname(&foundname, target, attributes,
&msg->sections[section]);
if (result == DNS_R_NOTFOUND) if (result == DNS_R_NOTFOUND)
return (DNS_R_NXDOMAIN); return (DNS_R_NXDOMAIN);
else if (result != DNS_R_SUCCESS) else if (result != DNS_R_SUCCESS)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment