diff options
author | 2011-06-16 11:46:55 +0000 | |
---|---|---|
committer | 2011-06-16 11:46:55 +0000 | |
commit | 417b8dd7baadbad421bfb2bbb3606ce8635f4d12 (patch) | |
tree | 77f8f3795036fc873ffd1a4eb015ed6242daeb9c | |
parent | Ethernet driver merged from IIJ's contribution code. (diff) | |
download | wireguard-openbsd-417b8dd7baadbad421bfb2bbb3606ce8635f4d12.tar.xz wireguard-openbsd-417b8dd7baadbad421bfb2bbb3606ce8635f4d12.zip |
clamp stratum to NTP_MAXSTRATUM. lingering in my tree for ages. someone likely
deserves to get credited for this, but I have no idea where that came from
-rw-r--r-- | usr.sbin/ntpd/ntp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c index 9fd4f370ef0..c02cf8dc269 100644 --- a/usr.sbin/ntpd/ntp.c +++ b/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.114 2009/06/11 17:36:53 henning Exp $ */ +/* $OpenBSD: ntp.c,v 1.115 2011/06/16 11:46:55 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -637,6 +637,8 @@ priv_adjtime(void) conf->status.reftime = gettime(); conf->status.stratum++; /* one more than selected peer */ + if (conf->status.stratum > NTP_MAXSTRATUM) + conf->status.stratum = NTP_MAXSTRATUM; update_scale(offset_median); conf->status.refid = offsets[i]->status.send_refid; |