From ec51b6d3d4b22ff81925152119c8a23283f4ccc0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 15 Feb 2018 20:31:51 +0100 Subject: [PATCH] Only clear DNS_ZONEFLG_LOADPENDING in zone_asyncload() if zone loading is completed immediately 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index f184bea574a..36af52b544c 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -1912,9 +1912,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 */ -- 2.47.3