diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 2222e2bf4c..68b6e6f32d 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -2356,16 +2356,18 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) { result = dns_db_addrdataset(res->view->cachedb, node, NULL, now, rdataset, 0, NULL); - if (result != ISC_R_SUCCESS && - result != DNS_R_UNCHANGED) + if (result == DNS_R_UNCHANGED) + result = ISC_R_SUCCESS; + if (result != ISC_R_SUCCESS) break; if (sigrdataset != NULL) { result = dns_db_addrdataset(res->view->cachedb, node, NULL, now, sigrdataset, 0, NULL); - if (result != ISC_R_SUCCESS && - result != DNS_R_UNCHANGED) + if (result == DNS_R_UNCHANGED) + result = ISC_R_SUCCESS; + if (result != ISC_R_SUCCESS) break; } if (ANSWER(rdataset)) {