summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-07-14 20:16:32 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-07-14 20:16:32 +0000
commitaf269e45b655d42d9dec4a8a6abab8572f4ef3a9 (patch)
tree8a1605b508ec52f2e5e443446b3aede6a372093a
parent0c7878c6dee2f38874f425806185365fe2610622 (diff)
do not do the stratum guessing dance.
stratum is pretty much pointless anyway these days, and we certainly do not want to send out illegal packets (stratum=0) until synced...
-rw-r--r--usr.sbin/ntpd/client.c3
-rw-r--r--usr.sbin/ntpd/ntp.c8
-rw-r--r--usr.sbin/ntpd/ntpd.h3
-rw-r--r--usr.sbin/ntpd/server.c4
4 files changed, 6 insertions, 12 deletions
diff --git a/usr.sbin/ntpd/client.c b/usr.sbin/ntpd/client.c
index 149ab165bc1..3c5c9fc8f69 100644
--- a/usr.sbin/ntpd/client.c
+++ b/usr.sbin/ntpd/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.24 2004/07/11 00:15:10 alexander Exp $ */
+/* $OpenBSD: client.c,v 1.25 2004/07/14 20:16:31 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -170,7 +170,6 @@ client_dispatch(struct ntp_peer *p)
p->reply[p->shift].good = 1;
p->reply[p->shift].status.leap = (msg.status & LIMASK) >> 6;
- p->reply[p->shift].status.stratum = msg.stratum;
p->reply[p->shift].status.precision = msg.precision;
p->reply[p->shift].status.rootdelay = sfp_to_d(msg.distance);
p->reply[p->shift].status.rootdispersion = sfp_to_d(msg.dispersion);
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index ac537634d88..efeddd56a18 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.23 2004/07/13 19:41:26 alexander Exp $ */
+/* $OpenBSD: ntp.c,v 1.24 2004/07/14 20:16:31 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -281,7 +281,7 @@ ntp_adjtime(struct ntpd_conf *conf)
{
struct ntp_peer *p;
double offset_median = 0;
- int offset_cnt = 0, stratum = 254;
+ int offset_cnt = 0;
TAILQ_FOREACH(p, &conf->ntp_peers, entry) {
if (!p->update.good)
@@ -297,9 +297,6 @@ ntp_adjtime(struct ntpd_conf *conf)
offset_median += p->update.offset;
offset_cnt++;
-
- if (p->update.status.stratum < stratum)
- stratum = p->update.status.stratum; /* XXX */
}
if (offset_cnt > 0) {
@@ -308,7 +305,6 @@ ntp_adjtime(struct ntpd_conf *conf)
&offset_median, sizeof(offset_median));
conf->status.reftime = gettime();
- conf->status.stratum = stratum + 1;
conf->status.leap = LI_NOWARNING; /* XXX */
}
}
diff --git a/usr.sbin/ntpd/ntpd.h b/usr.sbin/ntpd/ntpd.h
index 6379d1cd66d..0508fdbf590 100644
--- a/usr.sbin/ntpd/ntpd.h
+++ b/usr.sbin/ntpd/ntpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntpd.h,v 1.25 2004/07/13 19:41:26 alexander Exp $ */
+/* $OpenBSD: ntpd.h,v 1.26 2004/07/14 20:16:31 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -72,7 +72,6 @@ struct ntp_addr {
struct ntp_status {
u_int8_t leap;
- u_int8_t stratum;
int8_t precision;
double rootdelay;
double rootdispersion;
diff --git a/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c
index cea725918bb..25fdb861b75 100644
--- a/usr.sbin/ntpd/server.c
+++ b/usr.sbin/ntpd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.10 2004/07/13 19:41:26 alexander Exp $ */
+/* $OpenBSD: server.c,v 1.11 2004/07/14 20:16:31 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -122,7 +122,7 @@ server_dispatch(int fd, struct ntpd_conf *conf)
else
reply.status |= MODE_SYM_PAS;
- reply.stratum = conf->status.stratum;
+ reply.stratum = 2;
reply.ppoll = query.ppoll;
reply.precision = conf->status.precision;
reply.rectime = d_to_lfp(rectime);