From 0fe5ca5a175152326a55e52ea47732b14a6a8afa Mon Sep 17 00:00:00 2001 From: henning <> Date: Wed, 13 Oct 2004 13:35:19 +0000 Subject: [PATCH] in struct ntp_msg, rename "distance" to "rootdelay" to closer match RFCs and such --- src/usr.sbin/ntpd/client.c | 4 ++-- src/usr.sbin/ntpd/ntp.h | 4 ++-- src/usr.sbin/ntpd/ntp_msg.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c index cc9946b9..230b3d7c 100644 --- a/src/usr.sbin/ntpd/client.c +++ b/src/usr.sbin/ntpd/client.c @@ -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 @@ -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.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.refid = ntohl(msg.refid); p->reply[p->shift].status.reftime = lfp_to_d(msg.reftime); diff --git a/src/usr.sbin/ntpd/ntp.h b/src/usr.sbin/ntpd/ntp.h index b0129618..b2ec6fe2 100644 --- a/src/usr.sbin/ntpd/ntp.h +++ b/src/usr.sbin/ntpd/ntp.h @@ -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 @@ -98,7 +98,7 @@ struct ntp_msg { u_int8_t stratum; /* Stratum level */ u_int8_t ppoll; /* poll value */ int8_t precision; - struct s_fixedpt distance; + struct s_fixedpt rootdelay; struct s_fixedpt dispersion; u_int32_t refid; struct l_fixedpt reftime; diff --git a/src/usr.sbin/ntpd/ntp_msg.c b/src/usr.sbin/ntpd/ntp_msg.c index bd525fd2..6ad8128e 100644 --- a/src/usr.sbin/ntpd/ntp_msg.c +++ b/src/usr.sbin/ntpd/ntp_msg.c @@ -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 @@ -42,10 +42,10 @@ ntp_getmsg(char *p, ssize_t len, struct ntp_msg *msg) p += sizeof(msg->ppoll); memcpy(&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)); p += sizeof(msg->dispersion.int_part); 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); memcpy(p, &msg->precision, 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)); p += sizeof(msg->dispersion.int_part); memcpy(p, &msg->dispersion.fraction, sizeof(msg->dispersion.fraction));