Browse Source

in struct ntp_msg, rename "distance" to "rootdelay" to closer match RFCs

and such
OPENBSD_3_7
henning 20 years ago
parent
commit
0fe5ca5a17
3 changed files with 13 additions and 13 deletions
  1. +2
    -2
      src/usr.sbin/ntpd/client.c
  2. +2
    -2
      src/usr.sbin/ntpd/ntp.h
  3. +9
    -9
      src/usr.sbin/ntpd/ntp_msg.c

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

@ -1,4 +1,4 @@
/* $OpenBSD: client.c,v 1.39 2004/10/13 13:19:44 henning Exp $ */
/* $OpenBSD: client.c,v 1.40 2004/10/13 13:35:19 henning Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -219,7 +219,7 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
p->reply[p->shift].status.leap = (msg.status & LIMASK) >> 6; p->reply[p->shift].status.leap = (msg.status & LIMASK) >> 6;
p->reply[p->shift].status.precision = msg.precision; p->reply[p->shift].status.precision = msg.precision;
p->reply[p->shift].status.rootdelay = sfp_to_d(msg.distance);
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.rootdispersion = sfp_to_d(msg.dispersion);
p->reply[p->shift].status.refid = ntohl(msg.refid); p->reply[p->shift].status.refid = ntohl(msg.refid);
p->reply[p->shift].status.reftime = lfp_to_d(msg.reftime); p->reply[p->shift].status.reftime = lfp_to_d(msg.reftime);


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

@ -1,4 +1,4 @@
/* $OpenBSD: ntp.h,v 1.8 2004/07/10 22:04:22 alexander Exp $ */
/* $OpenBSD: ntp.h,v 1.9 2004/10/13 13:35:19 henning Exp $ */
/* /*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@ -98,7 +98,7 @@ struct ntp_msg {
u_int8_t stratum; /* Stratum level */ u_int8_t stratum; /* Stratum level */
u_int8_t ppoll; /* poll value */ u_int8_t ppoll; /* poll value */
int8_t precision; int8_t precision;
struct s_fixedpt distance;
struct s_fixedpt rootdelay;
struct s_fixedpt dispersion; struct s_fixedpt dispersion;
u_int32_t refid; u_int32_t refid;
struct l_fixedpt reftime; struct l_fixedpt reftime;


+ 9
- 9
src/usr.sbin/ntpd/ntp_msg.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntp_msg.c,v 1.8 2004/10/13 12:37:47 henning Exp $ */
/* $OpenBSD: ntp_msg.c,v 1.9 2004/10/13 13:35:19 henning Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -42,10 +42,10 @@ ntp_getmsg(char *p, ssize_t len, struct ntp_msg *msg)
p += sizeof(msg->ppoll); p += sizeof(msg->ppoll);
memcpy(&msg->precision, p, sizeof(msg->precision)); memcpy(&msg->precision, p, sizeof(msg->precision));
p += sizeof(msg->precision); p += sizeof(msg->precision);
memcpy(&msg->distance.int_part, p, sizeof(msg->distance.int_part));
p += sizeof(msg->distance.int_part);
memcpy(&msg->distance.fraction, p, sizeof(msg->distance.fraction));
p += sizeof(msg->distance.fraction);
memcpy(&msg->rootdelay.int_part, p, sizeof(msg->rootdelay.int_part));
p += sizeof(msg->rootdelay.int_part);
memcpy(&msg->rootdelay.fraction, p, sizeof(msg->rootdelay.fraction));
p += sizeof(msg->rootdelay.fraction);
memcpy(&msg->dispersion.int_part, p, sizeof(msg->dispersion.int_part)); memcpy(&msg->dispersion.int_part, p, sizeof(msg->dispersion.int_part));
p += sizeof(msg->dispersion.int_part); p += sizeof(msg->dispersion.int_part);
memcpy(&msg->dispersion.fraction, p, sizeof(msg->dispersion.fraction)); memcpy(&msg->dispersion.fraction, p, sizeof(msg->dispersion.fraction));
@ -89,10 +89,10 @@ ntp_sendmsg(int fd, struct sockaddr *sa, struct ntp_msg *msg, ssize_t len,
p += sizeof(msg->ppoll); p += sizeof(msg->ppoll);
memcpy(p, &msg->precision, sizeof(msg->precision)); memcpy(p, &msg->precision, sizeof(msg->precision));
p += sizeof(msg->precision); p += sizeof(msg->precision);
memcpy(p, &msg->distance.int_part, sizeof(msg->distance.int_part));
p += sizeof(msg->distance.int_part);
memcpy(p, &msg->distance.fraction, sizeof(msg->distance.fraction));
p += sizeof(msg->distance.fraction);
memcpy(p, &msg->rootdelay.int_part, sizeof(msg->rootdelay.int_part));
p += sizeof(msg->rootdelay.int_part);
memcpy(p, &msg->rootdelay.fraction, sizeof(msg->rootdelay.fraction));
p += sizeof(msg->rootdelay.fraction);
memcpy(p, &msg->dispersion.int_part, sizeof(msg->dispersion.int_part)); memcpy(p, &msg->dispersion.int_part, sizeof(msg->dispersion.int_part));
p += sizeof(msg->dispersion.int_part); p += sizeof(msg->dispersion.int_part);
memcpy(p, &msg->dispersion.fraction, sizeof(msg->dispersion.fraction)); memcpy(p, &msg->dispersion.fraction, sizeof(msg->dispersion.fraction));


Loading…
Cancel
Save