Browse Source

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...
OPENBSD_3_6
henning 20 years ago
parent
commit
4a343adcd5
4 changed files with 6 additions and 12 deletions
  1. +1
    -2
      src/usr.sbin/ntpd/client.c
  2. +2
    -6
      src/usr.sbin/ntpd/ntp.c
  3. +1
    -2
      src/usr.sbin/ntpd/ntpd.h
  4. +2
    -2
      src/usr.sbin/ntpd/server.c

+ 1
- 2
src/usr.sbin/ntpd/client.c View File

@ -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);


+ 2
- 6
src/usr.sbin/ntpd/ntp.c View File

@ -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 */
}
}

+ 1
- 2
src/usr.sbin/ntpd/ntpd.h View File

@ -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;


+ 2
- 2
src/usr.sbin/ntpd/server.c View File

@ -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);


Loading…
Cancel
Save