]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
simplify code
authorLibor Peltan <libor.peltan@nic.cz>
Tue, 1 Mar 2022 08:36:02 +0000 (09:36 +0100)
committerLibor Peltan <libor.peltan@nic.cz>
Tue, 1 Mar 2022 08:36:02 +0000 (09:36 +0100)
src/knot/events/replan.c

index f6e03c2f16c8035f99f88343e17bb0fc73355a98..31d39081d70ff2c19a2c5d863eaa7da3281f107a 100644 (file)
@@ -78,11 +78,6 @@ static void replan_dnssec(conf_t *conf, zone_t *zone)
        }
 }
 
-static bool can_expire(const zone_t *zone)
-{
-       return !zone_expired(zone) && zone_soa_expire(zone) > 0;
-}
-
 /*!
  * \brief Replan events that depend on zone timers (REFRESH, EXPIRE, FLUSH, RESALT, PARENT DS QUERY).
  */
@@ -104,13 +99,13 @@ void replan_from_timers(conf_t *conf, zone_t *zone)
 
        time_t expire_pre = TIME_IGNORE;
        time_t expire = TIME_IGNORE;
-       if (zone_is_slave(conf, zone) && can_expire(zone)) {
+       if (zone_is_slave(conf, zone) && !zone_expired(zone)) {
                expire_pre = TIME_CANCEL;
                expire = zone->timers.next_expire;
        }
 
        time_t flush = TIME_IGNORE;
-       if (!zone_is_slave(conf, zone) || can_expire(zone)) {
+       if (!zone_is_slave(conf, zone) || !zone_expired(zone)) {
                conf_val_t val = conf_zone_get(conf, C_ZONEFILE_SYNC, zone->name);
                int64_t sync_timeout = conf_int(&val);
                if (sync_timeout > 0) {