dns_zonefetch_t *fetch = NULL;
dns_keyfetch_t *kfetch = NULL;
+ /*
+ * This is a special query for RFC5011 maintenance
+ * of a trust anchor. We will be validating it
+ * in keyfetch_done() against a previously-known
+ * trust anchor; we do not want the normal
+ * validation process to occur. We set
+ * DNS_FETCHOPT_NOVALIDATE to suppress validation
+ * in the resolver, and DNS_FETCHOPT_UNSHARED so
+ * this fetch isn't combined with another one that
+ * might be validating.
+ *
+ * We must also use DNS_FETCHOPT_NOCACHED, because
+ * if it was not set and the cache still held a
+ * non-expired, validated version of the DNSKEY,
+ * then we'd receive the old, cached version
+ * instead of the new response - the old version
+ * would have a higher trust level.
+ */
fetch = isc_mem_get(zone->mctx,
sizeof(dns_zonefetch_t));
*fetch = (dns_zonefetch_t){
fetch = isc_mem_get(zone->mctx, sizeof(dns_zonefetch_t));
*fetch = (dns_zonefetch_t){
.zone = zone,
- .options = DNS_FETCHOPT_UNSHARED |
- DNS_FETCHOPT_NOCACHED,
.fetchtype = ZONEFETCHTYPE_NS,
.fetchmethods =
(dns_zonefetch_methods_t){
zfetch = isc_mem_get(zone->mctx, sizeof(dns_zonefetch_t));
*zfetch = (dns_zonefetch_t){
.zone = zone,
- .options = DNS_FETCHOPT_UNSHARED |
- DNS_FETCHOPT_NOCACHED,
.fetchtype = ZONEFETCHTYPE_DSYNC,
.fetchmethods =
(dns_zonefetch_methods_t){
fetch = isc_mem_get(zone->mctx, sizeof(dns_zonefetch_t));
*fetch = (dns_zonefetch_t){
.zone = zone,
- .options = DNS_FETCHOPT_UNSHARED |
- DNS_FETCHOPT_NOCACHED,
.fetchtype = ZONEFETCHTYPE_NS,
.fetchmethods =
(dns_zonefetch_methods_t){
"Do fetch for %s/%s request", namebuf, typebuf);
}
- /*
- * Use of DNS_FETCHOPT_NOCACHED is essential here. If it is not
- * set and the cache still holds a non-expired, validated version
- * of the RRset being queried for by the time the response is
- * received, the cached RRset will be passed to dns_zonefetch_done()
- * instead of the one received in the response as the latter will
- * have a lower trust level due to not being validated until
- * dns_zonefetch_done() is called.
- */
- INSIST((fetch->options & DNS_FETCHOPT_NOCACHED) != 0);
-
result = dns_resolver_createfetch(
resolver, fetch->qname, fetch->qtype, NULL, NULL, NULL, NULL, 0,
fetch->options, 0, NULL, NULL, NULL, loop, dns_zonefetch_done,