+3912. [bug] Address some unrecoverable lookup failures. [RT #36330]
+
3910. [bug] Fix races to free event during shutdown. [RT#36720]
3909. [bug] When computing the number of elements required for a
unsigned int
dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
+ return dns_adb_probesize2(adb, addr, 0);
+}
+
+unsigned int
+dns_adb_probesize2(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups) {
int bucket;
unsigned int size;
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);
- if (addr->entry->to1232 > EDNSTOS)
+ if (addr->entry->to1232 > EDNSTOS || lookups >= 2)
size = 512;
- else if (addr->entry->to1432 > EDNSTOS)
+ else if (addr->entry->to1432 > EDNSTOS || lookups >= 1)
size = 1232;
else if (addr->entry->to4096 > EDNSTOS)
size = 1432;
else
size = 4096;
+ /*
+ * Don't shrink probe size below what we have seen due to multiple
+ * lookups.
+ */
+ if (lookups > 0 &&
+ size < addr->entry->udpsize && addr->entry->udpsize < 4096)
+ size = addr->entry->udpsize;
UNLOCK(&adb->entrylocks[bucket]);
return (size);
unsigned int
dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr);
+unsigned int
+dns_adb_probesize2(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups);
/*%
* Return suggested EDNS UDP size based on observed responses / failures.
+ * 'lookups' is the number of times the current lookup has been attempted.
*
* Requires:
*
if ((flags & FCTX_ADDRINFO_EDNSOK) != 0 &&
(query->options & DNS_FETCHOPT_EDNS512) == 0) {
- udpsize = dns_adb_probesize(fctx->adb,
- query->addrinfo);
+ udpsize = dns_adb_probesize2(fctx->adb,
+ query->addrinfo,
+ fctx->timeouts);
if (udpsize > res->udpsize)
udpsize = res->udpsize;
}
if ((options & DNS_FETCHOPT_TCP) != 0) {
broken_server = DNS_R_TRUNCATEDTCP;
keep_trying = ISC_TRUE;
- } else if ((query->options & DNS_FETCHOPT_NOEDNS0) == 0 &&
- (query->options & DNS_FETCHOPT_EDNS512) == 0 &&
- !triededns(fctx, &query->addrinfo->sockaddr)) {
- resend = ISC_TRUE;
} else {
options |= DNS_FETCHOPT_TCP;
resend = ISC_TRUE;