]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Only clear DNS_ZONEFLG_LOADPENDING in zone_asyncload() if zone loading is completed...
authorMichał Kępień <michal@isc.org>
Thu, 15 Feb 2018 19:31:51 +0000 (20:31 +0100)
committerMichał Kępień <michal@isc.org>
Fri, 16 Feb 2018 07:47:40 +0000 (08:47 +0100)
zone_load() is not always synchronous, it may only initiate an
asynchronous load and return DNS_R_CONTINUE, which means zone loading
has not yet been completed.  In such a case, zone_asyncload() must not
clear DNS_ZONEFLG_LOADPENDING immediately and leave that up to
zone_postload().

lib/dns/zone.c

index 99a03afd0488c056bf508093092d9e98f159aac4..183e11a8e80fa185d0cc2608de4c1931f3e51bb5 100644 (file)
@@ -2191,9 +2191,11 @@ zone_asyncload(isc_task_t *task, isc_event_t *event) {
                goto cleanup;
        }
 
-       zone_load(zone, 0, ISC_TRUE);
+       result = zone_load(zone, 0, ISC_TRUE);
 
-       DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_LOADPENDING);
+       if (result != DNS_R_CONTINUE) {
+               DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_LOADPENDING);
+       }
        UNLOCK_ZONE(zone);
 
        /* Inform the zone table we've finished loading */