* SOFTWARE.
*/
-/* $Id: message.c,v 1.131.2.4 2000/07/27 01:23:40 gson Exp $ */
+/* $Id: message.c,v 1.131.2.5 2000/07/27 17:18:46 bwelling Exp $ */
/***
*** Imports
}
static isc_result_t
-simple_findname(dns_name_t **foundname, dns_name_t *target,
+findname(dns_name_t **foundname, dns_name_t *target,
dns_namelist_t *section)
{
dns_name_t *curr;
return (ISC_R_NOTFOUND);
}
-static isc_result_t
-findname(dns_name_t **foundname, dns_name_t *target, unsigned int attributes,
- dns_namelist_t *section)
-{
- dns_name_t *curr;
-
- for (curr = ISC_LIST_TAIL(*section) ;
- curr != NULL ;
- curr = ISC_LIST_PREV(curr, link)) {
- if (dns_name_equal(curr, target) &&
- (curr->attributes & attributes) == attributes) {
- if (foundname != NULL)
- *foundname = curr;
- return (ISC_R_SUCCESS);
- }
- }
-
- return (ISC_R_NOTFOUND);
-}
-
isc_result_t
dns_message_findtype(dns_name_t *name, dns_rdatatype_t type,
dns_rdatatype_t covers, dns_rdataset_t **rdataset)
* name since we no longer need it, and set our name pointer
* to point to the name we found.
*/
- result = findname(&name2, name, 0, section);
+ result = findname(&name2, name, section);
/*
* If it is the first name in the section, accept it.
dns_section_t sectionid, isc_boolean_t preserve_order)
{
isc_region_t r;
- unsigned int count, rdatalen, attributes;
+ unsigned int count, rdatalen;
dns_name_t *name;
dns_name_t *name2;
dns_rdataset_t *rdataset;
result = ISC_R_NOMEMORY;
goto cleanup;
}
- attributes = 0;
- if (rdtype != dns_rdatatype_tsig) {
- if (rdtype == dns_rdatatype_cname) {
- name->attributes |= DNS_NAMEATTR_CNAME;
- attributes = DNS_NAMEATTR_CNAME;
- skip_name_search = ISC_TRUE;
- } else if (rdtype == dns_rdatatype_dname) {
- name->attributes |= DNS_NAMEATTR_DNAME;
- attributes = DNS_NAMEATTR_DNAME;
- skip_name_search = ISC_TRUE;
- }
- result = getrdata(source, msg, dctx, msg->rdclass,
- rdtype, rdatalen, rdata);
- } else
+ if (rdtype == dns_rdatatype_tsig)
result = getrdata(source, msg, dctx, rdclass,
rdtype, rdatalen, rdata);
+ else
+ result = getrdata(source, msg, dctx, msg->rdclass,
+ rdtype, rdatalen, rdata);
if (result != ISC_R_SUCCESS)
goto cleanup;
rdata->rdclass = rdclass;
if (rdtype == dns_rdatatype_sig && rdata->length > 0) {
covers = dns_rdata_covers(rdata);
- if (covers == dns_rdatatype_cname)
- attributes = DNS_NAMEATTR_CNAME;
- else if (covers == dns_rdatatype_dname)
- attributes = DNS_NAMEATTR_DNAME;
- else if (covers == 0 &&
+ if (covers == 0 &&
sectionid == DNS_SECTION_ADDITIONAL)
{
if (msg->sig0 != NULL) {
* allocated name since we no longer need it, and set
* our name pointer to point to the name we found.
*/
- result = findname(&name2, name, attributes, section);
+ result = findname(&name2, name, section);
/*
* If it is a new name, append to the section.
REQUIRE(*rdataset == NULL);
}
- if (msg->from_to_wire == DNS_MESSAGE_INTENTPARSE) {
- dns_rdatatype_t atype;
- unsigned int attributes;
-
- /*
- * 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_dname)
- attributes = DNS_NAMEATTR_DNAME;
+ result = findname(&foundname, target,
+ &msg->sections[section]);
- /*
- * Search through, looking for the name.
- */
- result = findname(&foundname, target, attributes,
- &msg->sections[section]);
- } else {
- /*
- * The message was not built by dns_message_parse()
- * and therefore does not have CNAMEs and DNAMEs
- * as separate names, and no DNS_NAMEATTR_CNAME
- * and DNS_NAMEATTR_DNAME attributes are maintained.
- * Therefore, we should not compare attributes.
- */
- result = simple_findname(&foundname, target,
- &msg->sections[section]);
- }
if (result == ISC_R_NOTFOUND)
return (DNS_R_NXDOMAIN);
else if (result != ISC_R_SUCCESS)