Browse Source

According to the latest SNTPv4 spec in RFC4330, secondary servers

return the address of the synchronization source as reference
identification.  Remove the obsolete special casing specified in RFC2030.
ok henning@
OPENBSD_4_4
naddy 16 years ago
parent
commit
ca3fb2ec5f
5 changed files with 6 additions and 14 deletions
  1. +1
    -2
      src/usr.sbin/ntpd/client.c
  2. +1
    -2
      src/usr.sbin/ntpd/ntp.c
  3. +1
    -2
      src/usr.sbin/ntpd/ntpd.h
  4. +1
    -2
      src/usr.sbin/ntpd/sensors.c
  5. +2
    -6
      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.79 2008/01/28 11:45:59 mpf Exp $ */
/* $OpenBSD: client.c,v 1.80 2008/06/10 03:46:09 naddy Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -263,7 +263,6 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
p->reply[p->shift].status.rootdelay = sfp_to_d(msg.rootdelay);
p->reply[p->shift].status.rootdispersion = sfp_to_d(msg.dispersion);
p->reply[p->shift].status.refid = ntohl(msg.refid);
p->reply[p->shift].status.refid4 = msg.xmttime.fractionl;
p->reply[p->shift].status.reftime = lfp_to_d(msg.reftime);
p->reply[p->shift].status.poll = msg.ppoll;
p->reply[p->shift].status.stratum = msg.stratum;


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

@ -1,4 +1,4 @@
/* $OpenBSD: ntp.c,v 1.105 2008/06/08 19:14:40 ckuethe Exp $ */
/* $OpenBSD: ntp.c,v 1.106 2008/06/10 03:46:09 naddy Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -576,7 +576,6 @@ priv_adjtime(void)
conf->status.stratum++; /* one more than selected peer */
update_scale(offset_median);
conf->status.refid4 = offsets[i]->status.refid4;
conf->status.refid = offsets[i]->status.send_refid;
free(offsets);


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

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.h,v 1.94 2008/06/09 18:30:48 deraadt Exp $ */
/* $OpenBSD: ntpd.h,v 1.95 2008/06/10 03:46:09 naddy Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -97,7 +97,6 @@ struct ntp_status {
double rootdispersion;
double reftime;
u_int32_t refid;
u_int32_t refid4;
u_int32_t send_refid;
u_int8_t synced;
u_int8_t leap;


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

@ -1,4 +1,4 @@
/* $OpenBSD: sensors.c,v 1.39 2008/06/09 18:30:48 deraadt Exp $ */
/* $OpenBSD: sensors.c,v 1.40 2008/06/10 03:46:09 naddy Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@ -191,7 +191,6 @@ sensor_query(struct ntp_sensor *s)
s->offsets[s->shift].good = 1;
s->offsets[s->shift].status.refid = s->refid;
s->offsets[s->shift].status.refid4 = s->refid;
s->offsets[s->shift].status.stratum = 0; /* increased when sent out */
s->offsets[s->shift].status.rootdelay = 0;
s->offsets[s->shift].status.rootdispersion = 0;


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

@ -1,4 +1,4 @@
/* $OpenBSD: server.c,v 1.31 2007/01/15 08:19:11 otto Exp $ */
/* $OpenBSD: server.c,v 1.32 2008/06/10 03:46:09 naddy Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -162,11 +162,7 @@ server_dispatch(int fd, struct ntpd_conf *lconf)
reply.xmttime = d_to_lfp(gettime_corrected());
reply.orgtime = query.xmttime;
reply.rootdelay = d_to_sfp(lconf->status.rootdelay);
if (version > 3)
reply.refid = lconf->status.refid4;
else
reply.refid = lconf->status.refid;
reply.refid = lconf->status.refid;
ntp_sendmsg(fd, (struct sockaddr *)&fsa, &reply, size, 0);
return (0);


Loading…
Cancel
Save