diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sbin/ntpd/ntp.c index 7e9eff3b..4144bd7a 100644 --- a/src/usr.sbin/ntpd/ntp.c +++ b/src/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.110 2009/01/26 11:51:50 henning Exp $ */ +/* $OpenBSD: ntp.c,v 1.111 2009/06/04 23:39:45 ckuethe Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -530,6 +530,11 @@ priv_adjfreq(double offset) if (!conf->status.synced) return; + if (conf->filters & FILTER_ADJFREQ){ + conf->filters &= ~FILTER_ADJFREQ; + return; + } + conf->freq.samples++; if (conf->freq.samples <= 0) @@ -558,6 +563,7 @@ priv_adjfreq(double offset) freq = -MAX_FREQUENCY_ADJUST; imsg_compose(ibuf_main, IMSG_ADJFREQ, 0, 0, &freq, sizeof(freq)); + conf->filters |= FILTER_ADJFREQ; conf->freq.xy = 0.0; conf->freq.x = 0.0; conf->freq.y = 0.0; diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h index 42bc0734..86829098 100644 --- a/src/usr.sbin/ntpd/ntpd.h +++ b/src/usr.sbin/ntpd/ntpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.h,v 1.100 2009/05/13 15:08:10 stevesk Exp $ */ +/* $OpenBSD: ntpd.h,v 1.101 2009/06/04 23:39:46 ckuethe Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -62,6 +62,7 @@ #define REPORT_INTERVAL (24*60*60) /* interval between status reports */ #define MAX_SEND_ERRORS 3 /* max send errors before reconnect */ +#define FILTER_ADJFREQ 0x01 /* set after doing adjfreq */ #define SENSOR_DATA_MAXAGE (15*60) #define SENSOR_QUERY_INTERVAL 30 @@ -171,11 +172,12 @@ struct ntpd_conf { TAILQ_HEAD(ntp_conf_sensors, ntp_conf_sensor) ntp_conf_sensors; struct ntp_status status; struct ntp_freq freq; + u_int32_t scale; u_int8_t listen_all; u_int8_t settime; u_int8_t debug; - u_int32_t scale; u_int8_t noaction; + u_int8_t filters; }; struct buf {