diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2006-05-28 19:04:38 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2006-05-28 19:04:38 +0000 |
commit | d9b860e4f447ac3c7515ab8d4d8b88d4fcce3895 (patch) | |
tree | 26611c9acac25f85ffd4f0055ddc95760248fb44 /usr.sbin | |
parent | 8b66590c8e7bdb107b4997b2f172e83da6ff296b (diff) |
get clock src id from the timedelta sensor desc.
unfortunately I still don't have any hardware to test this ;(
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ntpd/sensors.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c index 0b26937deb2..47c4b8156b0 100644 --- a/usr.sbin/ntpd/sensors.c +++ b/usr.sbin/ntpd/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.13 2006/05/28 18:48:20 henning Exp $ */ +/* $OpenBSD: sensors.c,v 1.14 2006/05/28 19:04:37 henning Exp $ */ /* * Copyright (c) 2006 Henning Brauer <henning@openbsd.org> @@ -154,14 +154,15 @@ sensor_query(struct ntp_sensor *s) if (sensor.tv.tv_sec == s->update.rcvd) /* already seen */ return; + /* 1st 4 bytes of the desc are required to be the clock src code */ + bcopy(sensor.desc, &s->update.status.refid, + sizeof(s->update.status.refid)); + s->update.offset = 0 - (float)sensor.value / 1000000000.0; s->update.status.stratum = 0; /* increased when sent out */ s->update.status.rootdelay = 0; s->update.status.rootdispersion = 0; s->update.status.reftime = sensor.tv.tv_sec; - - /* XXX 4 char, 'DCF ', 'GPS ', 'PPS ' and the like */ - s->update.status.refid = 0; s->update.rcvd = sensor.tv.tv_sec; s->update.good = 1; |