summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/ntp.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2019-11-10 19:24:48 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2019-11-10 19:24:48 +0000
commit276b038981aaf21c2d43ac1c699a20cb49c37a0b (patch)
treed2a1fca6a3bca282751e265b3005383d87a77def /usr.sbin/ntpd/ntp.c
parent254bbec33be76481fb6d64720bbc86f44808d354 (diff)
Introduce a "trusted" modifier, for peers that should be on a local net
used in situations where https constraints cannot be used and we still want auto settime. Result of discussion with and ok deraadt@
Diffstat (limited to 'usr.sbin/ntpd/ntp.c')
-rw-r--r--usr.sbin/ntpd/ntp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index d8bb26e9227..f3f5041331a 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.160 2019/11/10 07:32:58 otto Exp $ */
+/* $OpenBSD: ntp.c,v 1.161 2019/11/10 19:24:47 otto Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -246,7 +246,8 @@ ntp_main(struct ntpd_conf *nconf, struct passwd *pw, int argc, char **argv)
idx_peers = i;
sent_cnt = trial_cnt = 0;
TAILQ_FOREACH(p, &conf->ntp_peers, entry) {
- if (constraint_cnt && conf->constraint_median == 0)
+ if (!p->trusted && constraint_cnt &&
+ conf->constraint_median == 0)
continue;
if (p->next > 0 && p->next <= getmonotime()) {