]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: fix calculation of PHC sample time
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Nov 2016 09:06:06 +0000 (10:06 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Nov 2016 09:08:36 +0000 (10:08 +0100)
ntp_io_linux.c

index 349fe1e57bd704a2f888ffa3689dd2b8152a5529..9cf791bf59b46e103642f7aa7c4301657b7170fe 100644 (file)
@@ -336,7 +336,7 @@ get_phc_sample(int phc_fd, struct timespec *phc_ts, struct timespec *local_ts, d
   assert(n);
 
   UTI_AddDoubleToTimespec(&phc_tss[0], phc_sum / n, phc_ts);
-  UTI_AddDoubleToTimespec(&sys_tss[0], phc_sum / n, &ts1);
+  UTI_AddDoubleToTimespec(&sys_tss[0], local_sum / n, &ts1);
   LCL_CookTime(&ts1, local_ts, NULL);
   *p_delay = min_delay;