26 lines
931 B
Diff
26 lines
931 B
Diff
commit 14ad8ddef480df52e090bfea65b4ae081c241506
|
|
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
|
Date: Fri Nov 22 18:19:42 2013 +0100
|
|
|
|
Set time stamp in chrony SOCK sample correctly.
|
|
|
|
The tv field should be the local time when was the sample received, not
|
|
the reference time. Otherwise the sample could be ignored as coming from
|
|
future.
|
|
|
|
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
|
|
|
|
diff --git a/ntpshm.c b/ntpshm.c
|
|
index 109e4ea..fe8e450 100644
|
|
--- a/ntpshm.c
|
|
+++ b/ntpshm.c
|
|
@@ -351,7 +351,7 @@ static void chrony_send(struct gps_device_t *session, struct timedrift_t *td)
|
|
sample.leap = session->context->leap_notify;
|
|
sample.magic = SOCK_MAGIC;
|
|
/*@-type@*//* splint is confused about struct timespec */
|
|
- TSTOTV(&sample.tv, &td->real);
|
|
+ TSTOTV(&sample.tv, &td->clock);
|
|
/*@-compdef@*/
|
|
sample.offset = timespec_diff_ns(td->real, td->clock) / 1e9;
|
|
/*@+compdef@*/
|