From: Harlan Stenn Date: Sun, 31 Aug 2008 03:14:01 +0000 (-0400) Subject: Fix a corner case where a frequency update was reported but not set X-Git-Tag: NTP_4_2_5P126~3^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5b1bd0adae9420fa89d095aa38bc9e8e9f4c264;p=thirdparty%2Fntp.git Fix a corner case where a frequency update was reported but not set bk: 48ba0c79XlHlO3v9liEGj0pY5oHOmg --- diff --git a/ChangeLog b/ChangeLog index 2c474de4f..ad0f9e4d5 100644 --- 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 diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index 725828403..dd5162da0 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -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); }