mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 08:35:31 +00:00
set eresult based on the type in ncache_adderesult()
when the caching of a negative record failed because of the presence of a positive one, ncache_adderesult() could override this to ISC_R_SUCCESS. this could cause CNAME and DNAME responses to be handled incorrectly. ncache_adderesult() now sets the result code correctly in such cases.
This commit is contained in:
@@ -6422,15 +6422,21 @@ ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Either we don't care about the nature of the
|
* The attempt to add a negative cache entry
|
||||||
* cache rdataset (because no fetch is
|
* was rejected. Set *eresultp to reflect
|
||||||
* interested in the outcome), or the cache
|
* the type of the dataset being returned.
|
||||||
* rdataset is not a negative cache entry.
|
|
||||||
* Whichever case it is, we can return success.
|
|
||||||
*
|
|
||||||
* XXXRTH There's a CNAME/DNAME problem here.
|
|
||||||
*/
|
*/
|
||||||
*eresultp = ISC_R_SUCCESS;
|
switch (ardataset->type) {
|
||||||
|
case dns_rdatatype_cname:
|
||||||
|
*eresultp = DNS_R_CNAME;
|
||||||
|
break;
|
||||||
|
case dns_rdatatype_dname:
|
||||||
|
*eresultp = DNS_R_DNAME;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*eresultp = ISC_R_SUCCESS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
result = ISC_R_SUCCESS;
|
result = ISC_R_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user