summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2006-05-27 18:32:00 +0000
committerhenning <henning@openbsd.org>2006-05-27 18:32:00 +0000
commitd3b079b5c91f735adc565c038502117d694120d3 (patch)
tree95b7fa8886c51ed557f6e48817635f9093d99c4f
parentKill unused Aflag support that sneeked in via netstat code. (diff)
downloadwireguard-openbsd-d3b079b5c91f735adc565c038502117d694120d3.tar.xz
wireguard-openbsd-d3b079b5c91f735adc565c038502117d694120d3.zip
scan for new timedelta sensors every five minutes for now, ok deraadt
-rw-r--r--usr.sbin/ntpd/ntp.c9
-rw-r--r--usr.sbin/ntpd/ntpd.h3
2 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 3fdeb0dcc7c..ae7418d0261 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.71 2006/05/26 00:33:16 henning Exp $ */
+/* $OpenBSD: ntp.c,v 1.72 2006/05/27 18:32:00 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -76,7 +76,7 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
struct ntp_sensor *s, *next_s;
struct timespec tp;
struct stat stb;
- time_t nextaction;
+ time_t nextaction, last_sensor_scan = 0;
void *newp;
switch (pid = fork()) {
@@ -149,7 +149,6 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
conf->scale = 1;
sensor_init(conf);
- sensor_scan(conf);
log_info("ntp engine ready");
@@ -232,6 +231,10 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
}
}
+ if (last_sensor_scan + SENSOR_SCAN_INTERVAL < time(NULL)) {
+ sensor_scan(conf);
+ last_sensor_scan = time(NULL);
+ }
sensors_cnt = 0;
TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
sensors_cnt++;
diff --git a/usr.sbin/ntpd/ntpd.h b/usr.sbin/ntpd/ntpd.h
index 546e8d8279f..5d3086ad862 100644
--- a/usr.sbin/ntpd/ntpd.h
+++ b/usr.sbin/ntpd/ntpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntpd.h,v 1.64 2006/05/27 17:01:07 henning Exp $ */
+/* $OpenBSD: ntpd.h,v 1.65 2006/05/27 18:32:00 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -60,6 +60,7 @@
#define SENSOR_DATA_MAXAGE 15*60
#define SENSOR_QUERY_INTERVAL 30
+#define SENSOR_SCAN_INTERVAL 5*60
enum client_state {
STATE_NONE,