From: Mark Andrews Date: Mon, 5 Jan 2004 06:44:30 +0000 (+0000) Subject: 1547. [bug] Named wasted memory recording duplicate lame zone X-Git-Tag: v9.2.4rc1~81^2~53 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=fd447061627e77db3ccf2536e14134e50647b9be;p=thirdparty%2Fbind9.git 1547. [bug] Named wasted memory recording duplicate lame zone entries. [RT #9341] --- diff --git a/CHANGES b/CHANGES index 9551ca103d4..324f5f84939 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1547. [bug] Named wasted memory recording duplicate lame zone + entries. [RT #9341] + 1546. [bug] We were rejecting valid secure CNAME to negative answers. diff --git a/lib/dns/adb.c b/lib/dns/adb.c index e05affd0b43..e3ea8761023 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: adb.c,v 1.211 2003/10/25 00:31:08 jinmei Exp $ */ +/* $Id: adb.c,v 1.212 2004/01/05 06:44:30 marka Exp $ */ /* * Implementation notes @@ -3313,20 +3313,32 @@ dns_adb_marklame(dns_adb_t *adb, dns_adbaddrinfo_t *addr, dns_name_t *zone, { dns_adbzoneinfo_t *zi; int bucket; + isc_result_t result = ISC_R_SUCCESS; REQUIRE(DNS_ADB_VALID(adb)); REQUIRE(DNS_ADBADDRINFO_VALID(addr)); REQUIRE(zone != NULL); + bucket = addr->entry->lock_bucket; + LOCK(&adb->entrylocks[bucket]); + zi = ISC_LIST_HEAD(addr->entry->zoneinfo); + while (zi != NULL && dns_name_equal(zone, &zi->zone)) + zi = ISC_LIST_NEXT(zi, plink); + if (zi != NULL) { + if (expire_time > zi->lame_timer) + zi->lame_timer = expire_time; + goto unlock; + } zi = new_adbzoneinfo(adb, zone); - if (zi == NULL) - return (ISC_R_NOMEMORY); + if (zi == NULL) { + result = ISC_R_NOMEMORY; + goto unlock; + } zi->lame_timer = expire_time; - bucket = addr->entry->lock_bucket; - LOCK(&adb->entrylocks[bucket]); ISC_LIST_PREPEND(addr->entry->zoneinfo, zi, plink); + unlock: UNLOCK(&adb->entrylocks[bucket]); return (ISC_R_SUCCESS);