]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
reference: update our reference time on slew
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 31 Mar 2015 09:51:03 +0000 (11:51 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 31 Mar 2015 09:51:03 +0000 (11:51 +0200)
reference.c

index 14c74636aa963aca68d7439fa9a815ff979ff020..df2f74f0242a3b740e0d4761cb116529435400cc 100644 (file)
@@ -50,7 +50,7 @@ static int our_leap_sec;
 static int our_stratum;
 static uint32_t our_ref_id;
 static IPAddr our_ref_ip;
-struct timeval our_ref_time; /* Stored relative to reference, NOT local time */
+struct timeval our_ref_time;
 static double our_skew;
 static double our_residual_freq;
 static double our_root_delay;
@@ -162,6 +162,8 @@ handle_slew(struct timeval *raw,
   double delta;
   struct timeval now;
 
+  UTI_AdjustTimeval(&our_ref_time, cooked, &our_ref_time, &delta, dfreq, doffset);
+
   if (change_type == LCL_ChangeUnknownStep) {
     last_ref_update.tv_sec = 0;
     last_ref_update.tv_usec = 0;