]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fix a corner case where a frequency update was reported but not set
authorHarlan Stenn <stenn@ntp.org>
Sun, 31 Aug 2008 03:14:01 +0000 (23:14 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sun, 31 Aug 2008 03:14:01 +0000 (23:14 -0400)
bk: 48ba0c79XlHlO3v9liEGj0pY5oHOmg

ChangeLog
ntpd/ntp_loopfilter.c

index 2c474de4f771734832e360c11e651c51766c4057..ad0f9e4d50a8301e27944477df671b49a7892590 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 * Changes from Dave Mills:
+  Fix a corner case where a frequency update was reported but not set.
   When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have
   crypto_flags.
 (4.2.5p125) 2008/08/18 Released by Harlan Stenn <stenn@ntp.org>
index 725828403eb752f8b3f96e4356befeee56548152..dd5162da059ffcb1c8f9fad56be35d46a82ffe63 100644 (file)
@@ -124,7 +124,7 @@ double      clock_codec;            /* audio codec frequency (samples/s) */
 u_long clock_epoch;            /* interval since last update */
 u_int  sys_tai;                /* TAI offset from UTC */
 static void rstclock (int, double); /* transition function */
-static void direct_freq(double); /* direct set frequency */
+static double direct_freq(double); /* direct set frequency */
 static void set_freq(double);  /* set frequency */
 
 #ifdef KERNEL_PLL
@@ -346,7 +346,7 @@ local_clock(
                        if (clock_epoch < clock_minstep)
                                return (0);
 
-                       direct_freq(fp_offset);
+                       clock_frequency = direct_freq(fp_offset);
 
                        /* fall through to S_SPIK */
 
@@ -447,7 +447,7 @@ local_clock(
                        if (clock_epoch < clock_minstep)
                                return (0);
 
-                       direct_freq(fp_offset);
+                       clock_frequency = direct_freq(fp_offset);
                        rstclock(EVNT_SYNC, 0);
                        break;
 
@@ -765,7 +765,8 @@ rstclock(
  * interval and residual frequency component. At the same time the
  * frequenchy file is armed for update at the next hourly stats.
  */
-static void direct_freq(
+static double
+direct_freq(
        double  fp_offset
        )
 {
@@ -788,7 +789,7 @@ static void direct_freq(
 #endif /* KERNEL_PLL */
        set_freq((fp_offset - clock_offset) / clock_epoch + drift_comp);
        wander_resid = 0;
-       return;
+       return (drift_comp);
 }