Skip to content
Snippets Groups Projects
Commit 85e70fa2 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'fix_unplanned_re_sign' into 'master'

Fix unplanned re sign

See merge request !939
parents 640d68e8 33334d50
No related branches found
No related tags found
1 merge request!939Fix unplanned re sign
Pipeline #41446 passed
......@@ -132,8 +132,6 @@ src/knot/events/handlers/nsec3resalt.c
src/knot/events/handlers/parent_ds_query.c
src/knot/events/handlers/refresh.c
src/knot/events/handlers/update.c
src/knot/events/log.c
src/knot/events/log.h
src/knot/events/replan.c
src/knot/events/replan.h
src/knot/include/module.h
......
......@@ -73,8 +73,6 @@ libknotd_la_SOURCES = \
knot/events/handlers/refresh.c \
knot/events/handlers/update.c \
knot/events/handlers/parent_ds_query.c \
knot/events/log.c \
knot/events/log.h \
knot/events/replan.c \
knot/events/replan.h \
knot/nameserver/axfr.c \
......
......@@ -24,7 +24,7 @@
#include "knot/ctl/commands.h"
#include "knot/dnssec/key-events.h"
#include "knot/events/events.h"
#include "knot/events/log.h"
#include "knot/events/handlers.h"
#include "knot/nameserver/query_module.h"
#include "knot/updates/zone-update.h"
#include "knot/zone/timers.h"
......@@ -474,8 +474,7 @@ static int zone_txn_commit(zone_t *zone, ctl_args_t *args)
zone_txn_update_clear(zone);
return ret;
}
log_dnssec_next(zone->name, (time_t)resch.next_sign);
zone_events_schedule_at(zone, ZONE_EVENT_DNSSEC, (time_t)resch.next_sign);
event_dnssec_reschedule(conf(), zone, &resch, false);
}
int ret = zone_update_commit(conf(), zone->control_update);
......
......@@ -19,11 +19,24 @@
#include "knot/common/log.h"
#include "knot/conf/conf.h"
#include "knot/dnssec/zone-events.h"
#include "knot/events/log.h"
#include "knot/updates/apply.h"
#include "knot/zone/zone.h"
#include "libknot/errcode.h"
static void log_dnssec_next(const knot_dname_t *zone, knot_time_t refresh_at)
{
char time_str[64] = { 0 };
struct tm time_gm = { 0 };
time_t refresh = refresh_at;
localtime_r(&refresh, &time_gm);
strftime(time_str, sizeof(time_str), KNOT_LOG_TIME_FORMAT, &time_gm);
if (refresh_at == 0) {
log_zone_warning(zone, "DNSSEC, next signing not scheduled");
} else {
log_zone_info(zone, "DNSSEC, next signing at %s", time_str);
}
}
void event_dnssec_reschedule(conf_t *conf, zone_t *zone,
const zone_sign_reschedule_t *refresh, bool zone_changed)
{
......@@ -35,10 +48,6 @@ void event_dnssec_reschedule(conf_t *conf, zone_t *zone,
refresh_at = refresh->next_rollover;
}
if (refresh_at <= 0) {
return;
}
log_dnssec_next(zone->name, (time_t)refresh_at);
if (refresh->plan_ds_query) {
......@@ -50,7 +59,7 @@ void event_dnssec_reschedule(conf_t *conf, zone_t *zone,
}
zone_events_schedule_at(zone,
ZONE_EVENT_DNSSEC, (time_t)refresh_at,
ZONE_EVENT_DNSSEC, refresh_at ? (time_t)refresh_at : ignore,
ZONE_EVENT_PARENT_DS_Q, refresh->plan_ds_query ? now : ignore,
ZONE_EVENT_NSEC3RESALT, refresh->next_nsec3resalt ? refresh->next_nsec3resalt : ignore,
ZONE_EVENT_NOTIFY, zone_changed ? now : ignore
......
......@@ -21,7 +21,6 @@
#include "knot/dnssec/key-events.h"
#include "knot/dnssec/zone-events.h"
#include "knot/events/handlers.h"
#include "knot/events/log.h"
#include "knot/events/replan.h"
#include "knot/zone/zone-diff.h"
#include "knot/zone/zone-load.h"
......
......@@ -23,7 +23,6 @@
#include "knot/conf/conf.h"
#include "knot/dnssec/zone-events.h"
#include "knot/events/handlers.h"
#include "knot/events/log.h"
#include "knot/events/replan.h"
#include "knot/nameserver/ixfr.h"
#include "knot/query/layer.h"
......
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "knot/events/log.h"
#include "knot/common/log.h"
void log_dnssec_next(const knot_dname_t *zone, time_t refresh_at)
{
char time_str[64] = { 0 };
struct tm time_gm = { 0 };
localtime_r(&refresh_at, &time_gm);
strftime(time_str, sizeof(time_str), KNOT_LOG_TIME_FORMAT, &time_gm);
log_zone_info(zone, "DNSSEC, next signing at %s", time_str);
}
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <time.h>
#include "libknot/dname.h"
void log_dnssec_next(const knot_dname_t *zone, time_t refresh_at);
......@@ -19,7 +19,7 @@
#include "libdnssec/random.h"
#include "knot/common/log.h"
#include "knot/dnssec/zone-events.h"
#include "knot/events/log.h"
#include "knot/events/handlers.h"
#include "knot/query/capture.h"
#include "knot/query/requestor.h"
#include "knot/nameserver/update.h"
......@@ -167,8 +167,7 @@ static int process_normal(conf_t *conf, zone_t *zone, list_t *requests)
set_rcodes(requests, KNOT_RCODE_SERVFAIL);
return ret;
}
log_dnssec_next(zone->name, (time_t)resch.next_sign);
zone_events_schedule_at(zone, ZONE_EVENT_DNSSEC, (time_t)resch.next_sign);
event_dnssec_reschedule(conf, zone, &resch, false); // false since we handle NOTIFY after processing ddns queue
}
// Apply changes.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment