From dfe3068ef390b5bbc706530afff33d5722531f68 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 2 Feb 2017 17:11:15 +1100 Subject: [PATCH] 4563. [bug] Modified zones would occasionally fail to reload. [RT #39424] --- CHANGES | 3 +++ lib/dns/zone.c | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2a0a3cee4c..10e28a1357 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4563. [bug] Modified zones would occasionally fail to reload. + [RT #39424] + 4562. [func] Add additional memory statistics currently malloced and maxmalloced per memory context. [RT #43593] diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 367b380e76..089235d533 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -1828,7 +1828,6 @@ zone_touched(dns_zone_t *zone) { return (ISC_TRUE); } - return (ISC_FALSE); } @@ -1908,6 +1907,8 @@ zone_load(dns_zone_t *zone, unsigned int flags, isc_boolean_t locked) { * been loaded yet, zone->loadtime will be the epoch. */ if (zone->masterfile != NULL) { + isc_time_t filetime; + /* * The file is already loaded. If we are just doing a * "rndc reconfig", we are done. @@ -1927,6 +1928,16 @@ zone_load(dns_zone_t *zone, unsigned int flags, isc_boolean_t locked) { result = DNS_R_UPTODATE; goto cleanup; } + + + /* + * If the file modification time is in the past + * set loadtime to that value. + */ + result = isc_file_getmodtime(zone->masterfile, &filetime); + if (result == ISC_R_SUCCESS && + isc_time_compare(&loadtime, &filetime) > 0) + loadtime = filetime; } /*