mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
3975. [bug] Don't populate or use the bad cache for queries that
don't request or use recursion. [RT #37466]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
3975. [bug] Don't populate or use the bad cache for queries that
|
||||||
|
don't request or use recursion. [RT #37466]
|
||||||
|
|
||||||
3974. [bug] handle DH_compute_key() failure correctly in
|
3974. [bug] handle DH_compute_key() failure correctly in
|
||||||
openssldh_link.c. [RT #37477]
|
openssldh_link.c. [RT #37477]
|
||||||
|
|
||||||
|
@@ -6303,32 +6303,36 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
|||||||
* if the current query has CD=0, then we can just return
|
* if the current query has CD=0, then we can just return
|
||||||
* SERVFAIL now.
|
* SERVFAIL now.
|
||||||
*/
|
*/
|
||||||
flags = 0;
|
if (RECURSIONOK(client)) {
|
||||||
failcache = dns_badcache_find(client->view->failcache,
|
flags = 0;
|
||||||
client->query.qname, qtype,
|
failcache = dns_badcache_find(client->view->failcache,
|
||||||
&flags, &client->tnow);
|
client->query.qname, qtype,
|
||||||
if (failcache && (((flags & NS_FAILCACHE_CD) != 0) ||
|
&flags, &client->tnow);
|
||||||
((client->message->flags & DNS_MESSAGEFLAG_CD) == 0)))
|
if (failcache &&
|
||||||
{
|
(((flags & NS_FAILCACHE_CD) != 0) ||
|
||||||
if (isc_log_wouldlog(ns_g_lctx, ISC_LOG_DEBUG(1))) {
|
((client->message->flags & DNS_MESSAGEFLAG_CD) == 0)))
|
||||||
char namebuf[DNS_NAME_FORMATSIZE];
|
{
|
||||||
char typename[DNS_RDATATYPE_FORMATSIZE];
|
if (isc_log_wouldlog(ns_g_lctx, ISC_LOG_DEBUG(1))) {
|
||||||
|
char namebuf[DNS_NAME_FORMATSIZE];
|
||||||
|
char typename[DNS_RDATATYPE_FORMATSIZE];
|
||||||
|
|
||||||
dns_name_format(client->query.qname,
|
dns_name_format(client->query.qname,
|
||||||
namebuf, sizeof(namebuf));
|
namebuf, sizeof(namebuf));
|
||||||
dns_rdatatype_format(qtype,
|
dns_rdatatype_format(qtype, typename,
|
||||||
typename, sizeof(typename));
|
sizeof(typename));
|
||||||
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
||||||
NS_LOGMODULE_QUERY, ISC_LOG_DEBUG(1),
|
NS_LOGMODULE_QUERY,
|
||||||
"servfail cache hit %s/%s (%s)",
|
ISC_LOG_DEBUG(1),
|
||||||
namebuf, typename,
|
"servfail cache hit %s/%s (%s)",
|
||||||
((flags & NS_FAILCACHE_CD) != 0)
|
namebuf, typename,
|
||||||
? "CD=1"
|
((flags & NS_FAILCACHE_CD) != 0)
|
||||||
: "CD=0");
|
? "CD=1"
|
||||||
|
: "CD=0");
|
||||||
|
}
|
||||||
|
client->attributes |= NS_CLIENTATTR_NOSETFC;
|
||||||
|
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
client->attributes |= NS_CLIENTATTR_NOSETFC;
|
|
||||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -8385,6 +8389,7 @@ ns_query_start(ns_client_t *client) {
|
|||||||
*/
|
*/
|
||||||
client->query.attributes &=
|
client->query.attributes &=
|
||||||
~(NS_QUERYATTR_RECURSIONOK|NS_QUERYATTR_CACHEOK);
|
~(NS_QUERYATTR_RECURSIONOK|NS_QUERYATTR_CACHEOK);
|
||||||
|
client->query.attributes |= NS_CLIENTATTR_NOSETFC;
|
||||||
} else if ((client->attributes & NS_CLIENTATTR_RA) == 0 ||
|
} else if ((client->attributes & NS_CLIENTATTR_RA) == 0 ||
|
||||||
(message->flags & DNS_MESSAGEFLAG_RD) == 0) {
|
(message->flags & DNS_MESSAGEFLAG_RD) == 0) {
|
||||||
/*
|
/*
|
||||||
@@ -8394,6 +8399,7 @@ ns_query_start(ns_client_t *client) {
|
|||||||
* doesn't want recursion, turn recursion off.
|
* doesn't want recursion, turn recursion off.
|
||||||
*/
|
*/
|
||||||
client->query.attributes &= ~NS_QUERYATTR_RECURSIONOK;
|
client->query.attributes &= ~NS_QUERYATTR_RECURSIONOK;
|
||||||
|
client->query.attributes |= NS_CLIENTATTR_NOSETFC;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user