diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 79738fe595..bffd7f4673 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -14283,6 +14283,17 @@ next_primary: goto detach; exiting: + /* + * We can get here not only during shutdown, but also when the refresh + * is canceled during reconfiguration. In that case, make sure to clear + * the DNS_ZONEFLG_REFRESH flag so that future zone refreshes don't get + * stuck, and make sure a new refresh attempt is made again soon after + * the reconfiguration is complete. + */ + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH); + zone->refreshtime = now; + zone_settimer(zone, &now); + dns_request_destroy(&zone->request); goto detach;