From 8cbf220a1edbae02ff5ddbcaf2b6cbe2f01d5061 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 17 Aug 2015 10:37:06 +1000 Subject: [PATCH] 4181. [bug] Queued notify messages could be dequeued from the wrong rate limiter queue. [RT #40350] (cherry picked from commit 70862302f8f6a8398b6ca67516749486688603ca) --- CHANGES | 3 +++ lib/dns/zone.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 52b0a4150a..77fbd1ff81 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4181. [bug] Queued notify messages could be dequeued from the + wrong rate limiter queue. [RT #40350] + 4179. [bug] Fix double frees in getaddrinfo() in libirs. [RT #40209] diff --git a/lib/dns/zone.c b/lib/dns/zone.c index f90b5e1c55..90e558dd7a 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -10101,8 +10101,6 @@ notify_isqueued(dns_zone_t *zone, unsigned int flags, dns_name_t *name, notify = ISC_LIST_NEXT(notify, link)) { if (notify->request != NULL) continue; - if ((flags & DNS_NOTIFY_STARTUP) == 0) - notify->flags &= ~DNS_NOTIFY_STARTUP; if (name != NULL && dns_name_dynamic(¬ify->ns) && dns_name_equal(name, ¬ify->ns)) goto requeue; @@ -10118,12 +10116,15 @@ requeue: * not a startup notify, re-enqueue on the normal notify * ratelimiter. */ - if (notify->event != NULL && (flags & DNS_NOTIFY_STARTUP) == 0) { + if (notify->event != NULL && (flags & DNS_NOTIFY_STARTUP) == 0 && + (notify->flags & DNS_NOTIFY_STARTUP) != 0) { zmgr = notify->zone->zmgr; result = isc_ratelimiter_dequeue(zmgr->startupnotifyrl, notify->event); if (result != ISC_R_SUCCESS) return (ISC_TRUE); + + notify->flags &= ~DNS_NOTIFY_STARTUP; result = isc_ratelimiter_enqueue(notify->zone->zmgr->notifyrl, notify->zone->task, ¬ify->event);