]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4181. [bug] Queued notify messages could be dequeued from the
authorMark Andrews <marka@isc.org>
Mon, 17 Aug 2015 00:37:06 +0000 (10:37 +1000)
committerMark Andrews <marka@isc.org>
Mon, 17 Aug 2015 00:38:40 +0000 (10:38 +1000)
                        wrong rate limiter queue. [RT #40350]

(cherry picked from commit 70862302f8f6a8398b6ca67516749486688603ca)

CHANGES
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 1ad262b89eea393e35aead78b6daf5fa1871df26..61b5bc4828a7bb00615e61d6503a13b94e86b497 100644 (file)
--- 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]
 
index c3878dc5d734b8deb04c50dbadb8a82b5988dae6..d334bebc436cd68e0b77ff7178315309f54d074e 100644 (file)
@@ -9674,8 +9674,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(&notify->ns) &&
                    dns_name_equal(name, &notify->ns))
                        goto requeue;
@@ -9691,12 +9689,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,
                                                 &notify->event);