mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-24 15:47:18 -04:00
1547. [bug] Named wasted memory recording duplicate lame zone
entries. [RT #9341]
This commit is contained in:
parent
2137445c62
commit
3ec38eee2f
2 changed files with 20 additions and 5 deletions
3
CHANGES
3
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.
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: adb.c,v 1.181.2.11.2.12 2003/10/21 05:56:40 marka Exp $ */
|
||||
/* $Id: adb.c,v 1.181.2.11.2.13 2004/01/05 06:47:31 marka Exp $ */
|
||||
|
||||
/*
|
||||
* Implementation notes
|
||||
|
|
@ -3320,20 +3320,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue