mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-03 13:59:27 -04:00
Special case refresh stale ncache data
When refreshing stale ncache data, the qctx->rdataset is NULL and
requires special processing.
(cherry picked from commit 7774f16ed5)
This commit is contained in:
parent
667d81b52b
commit
03eb9aabe1
1 changed files with 24 additions and 5 deletions
|
|
@ -2824,12 +2824,19 @@ query_stale_refresh(ns_client_t *client, dns_name_t *qname,
|
|||
dns_rdataset_t *rdataset) {
|
||||
CTRACE(ISC_LOG_DEBUG(3), "query_stale_refresh");
|
||||
|
||||
bool stale_refresh_window =
|
||||
(STALE_WINDOW(rdataset) &&
|
||||
(client->query.dboptions & DNS_DBFIND_STALEENABLED) != 0);
|
||||
bool stale_refresh_window = false;
|
||||
bool stale_rrset = true;
|
||||
|
||||
if (rdataset != NULL) {
|
||||
stale_refresh_window = (STALE_WINDOW(rdataset) &&
|
||||
(client->query.dboptions &
|
||||
DNS_DBFIND_STALEENABLED) != 0);
|
||||
stale_rrset = STALE(rdataset);
|
||||
}
|
||||
|
||||
if (FETCH_RECTYPE_STALE_REFRESH(client) != NULL ||
|
||||
(client->query.dboptions & DNS_DBFIND_STALETIMEOUT) == 0 ||
|
||||
!STALE(rdataset) || stale_refresh_window)
|
||||
!stale_rrset || stale_refresh_window)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -2853,6 +2860,18 @@ query_stale_refresh(ns_client_t *client, dns_name_t *qname,
|
|||
RECTYPE_STALE_REFRESH);
|
||||
}
|
||||
|
||||
static void
|
||||
query_stale_refresh_ncache(ns_client_t *client) {
|
||||
dns_name_t *qname;
|
||||
|
||||
if (client->query.origqname != NULL) {
|
||||
qname = client->query.origqname;
|
||||
} else {
|
||||
qname = client->query.qname;
|
||||
}
|
||||
query_stale_refresh(client, qname, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
query_prefetch(ns_client_t *client, dns_name_t *qname,
|
||||
dns_rdataset_t *rdataset) {
|
||||
|
|
@ -10344,7 +10363,7 @@ query_ncache(query_ctx_t *qctx, isc_result_t result) {
|
|||
}
|
||||
|
||||
if (!qctx->is_zone && RECURSIONOK(qctx->client)) {
|
||||
query_stale_refresh(qctx->client, qctx->fname, qctx->rdataset);
|
||||
query_stale_refresh_ncache(qctx->client);
|
||||
}
|
||||
|
||||
return query_nodata(qctx, result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue