mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: adb.c,v 1.203 2003/02/27 02:20:15 marka Exp $ */
|
||||
/* $Id: adb.c,v 1.204 2003/07/18 04:30:01 marka Exp $ */
|
||||
|
||||
/*
|
||||
* Implementation notes
|
||||
@@ -86,6 +86,7 @@
|
||||
*/
|
||||
#define ADB_CACHE_MINIMUM 10 /* seconds */
|
||||
#define ADB_CACHE_MAXIMUM 86400 /* seconds (86400 = 24 hours) */
|
||||
#define ADB_ENTRY_WINDOW 1800 /* seconds */
|
||||
|
||||
/*
|
||||
* Wake up every CLEAN_SECONDS and clean CLEAN_BUCKETS buckets, so that all
|
||||
@@ -572,7 +573,11 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
|
||||
if (addr_bucket != DNS_ADB_INVALIDBUCKET)
|
||||
UNLOCK(&adb->entrylocks[addr_bucket]);
|
||||
|
||||
rdataset->ttl = ttlclamp(rdataset->ttl);
|
||||
if (rdataset->trust == dns_trust_glue ||
|
||||
rdataset->trust == dns_trust_additional)
|
||||
rdataset->ttl = ADB_CACHE_MINIMUM;
|
||||
else
|
||||
rdataset->ttl = ttlclamp(rdataset->ttl);
|
||||
|
||||
if (rdtype == dns_rdatatype_a) {
|
||||
DP(NCACHE_LEVEL, "expire_v4 set to MIN(%u,%u) import_rdataset",
|
||||
@@ -3336,6 +3341,7 @@ dns_adb_adjustsrtt(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
|
||||
{
|
||||
int bucket;
|
||||
unsigned int new_srtt;
|
||||
isc_stdtime_t now;
|
||||
|
||||
REQUIRE(DNS_ADB_VALID(adb));
|
||||
REQUIRE(DNS_ADBADDRINFO_VALID(addr));
|
||||
@@ -3353,6 +3359,9 @@ dns_adb_adjustsrtt(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
|
||||
addr->entry->srtt = new_srtt;
|
||||
addr->srtt = new_srtt;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
addr->entry->expires = now + ADB_ENTRY_WINDOW;
|
||||
|
||||
UNLOCK(&adb->entrylocks[bucket]);
|
||||
}
|
||||
|
||||
@@ -3450,7 +3459,7 @@ dns_adb_freeaddrinfo(dns_adb_t *adb, dns_adbaddrinfo_t **addrp) {
|
||||
bucket = addr->entry->lock_bucket;
|
||||
LOCK(&adb->entrylocks[bucket]);
|
||||
|
||||
entry->expires = now + 1800; /* XXXRTH */
|
||||
entry->expires = now + ADB_ENTRY_WINDOW;
|
||||
|
||||
want_check_exit = dec_entry_refcnt(adb, entry, ISC_FALSE);
|
||||
|
||||
|
Reference in New Issue
Block a user