mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-28 13:08:06 +00:00
627. [bug] The EDNS0 blackhole detection code of 327. waited
for three retransmissions to each server, which takes much too long when a domain has many name and all of them drop EDNS0 queries. Now we retry without EDNS0 after three consecutive timeouts, even if they are all from different servers.
This commit is contained in:
parent
86c3cd20dd
commit
7d33e89969
8
CHANGES
8
CHANGES
@ -1,3 +1,11 @@
|
||||
|
||||
627. [bug] The EDNS0 blackhole detection code of 327. waited
|
||||
for three retransmissions to each server, which
|
||||
takes much too long when a domain has many name
|
||||
and all of them drop EDNS0 queries. Now we retry
|
||||
without EDNS0 after three consecutive timeouts,
|
||||
even if they are all from different servers.
|
||||
|
||||
626. [bug] The lightweight resolver daemon no longer crashes
|
||||
when asked for a SIG rrset. [RT #558]
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: resolver.c,v 1.186 2000/12/11 19:24:20 bwelling Exp $ */
|
||||
/* $Id: resolver.c,v 1.187 2000/12/20 23:18:37 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -93,10 +93,10 @@
|
||||
#define SEND_BUFFER_SIZE 2048 /* XXXRTH Constant. */
|
||||
|
||||
/*
|
||||
* This defines the maximum number of restarts we will permit before we
|
||||
* This defines the maximum number of timeouts we will permit before we
|
||||
* disable EDNS0 on the query.
|
||||
*/
|
||||
#define NOEDNS0_RESTARTS 3
|
||||
#define MAX_EDNS0_TIMEOUTS 3
|
||||
|
||||
typedef struct fetchctx fetchctx_t;
|
||||
|
||||
@ -177,7 +177,17 @@ struct fetchctx {
|
||||
* # of events we're waiting for.
|
||||
*/
|
||||
unsigned int pending;
|
||||
/*
|
||||
* # of times we have started from the beginning
|
||||
* of the name server set.
|
||||
*/
|
||||
unsigned int restarts;
|
||||
/*
|
||||
* # of timeouts that have occurred since we last
|
||||
* successfully received a response packet. This
|
||||
* is used for EDNS0 black hole detectino.
|
||||
*/
|
||||
unsigned int timeouts;
|
||||
};
|
||||
|
||||
#define FCTX_MAGIC 0x46212121U /* F!!! */
|
||||
@ -904,9 +914,9 @@ resquery_send(resquery_t *query) {
|
||||
* Use EDNS0, unless the caller doesn't want it, or we know that
|
||||
* the remote server doesn't like it.
|
||||
*/
|
||||
if (fctx->restarts > NOEDNS0_RESTARTS) {
|
||||
if (fctx->timeouts >= MAX_EDNS0_TIMEOUTS) {
|
||||
query->options |= DNS_FETCHOPT_NOEDNS0;
|
||||
FCTXTRACE("too many restarts, disabling EDNS0");
|
||||
FCTXTRACE("too many timeouts, disabling EDNS0");
|
||||
}
|
||||
|
||||
if ((query->options & DNS_FETCHOPT_NOEDNS0) == 0) {
|
||||
@ -1770,6 +1780,7 @@ fctx_timeout(isc_task_t *task, isc_event_t *event) {
|
||||
if (event->ev_type == ISC_TIMEREVENT_LIFE) {
|
||||
fctx_done(fctx, ISC_R_TIMEDOUT);
|
||||
} else {
|
||||
fctx->timeouts++;
|
||||
/*
|
||||
* We could cancel the running queries here, or we could let
|
||||
* them keep going. Right now we choose the latter...
|
||||
@ -2047,6 +2058,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
|
||||
fctx->find = NULL;
|
||||
fctx->pending = 0;
|
||||
fctx->restarts = 0;
|
||||
fctx->timeouts = 0;
|
||||
if (dns_name_requiresedns(name))
|
||||
fctx->attributes = FCTX_ATTR_NEEDEDNS0;
|
||||
else
|
||||
@ -3892,6 +3904,8 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
|
||||
truncated = ISC_FALSE;
|
||||
finish = NULL;
|
||||
|
||||
fctx->timeouts = 0;
|
||||
|
||||
/*
|
||||
* XXXRTH We should really get the current time just once. We
|
||||
* need a routine to convert from an isc_time_t to an
|
||||
|
Loading…
x
Reference in New Issue
Block a user