From: Harlan Stenn Date: Tue, 29 Aug 2006 10:47:20 +0000 (-0400) Subject: loopfilter changes from Dave Mills X-Git-Tag: NTP_4_2_3P38~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6be3805db89668a6feb4754618f3624fc93964c3;p=thirdparty%2Fntp.git loopfilter changes from Dave Mills bk: 44f41b38loGiWhDvRV0DtSpm-hbfNg --- diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index 3dfafbe9c..ab7c1e030 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -540,14 +540,11 @@ local_clock( * clock, respectively. * * Important note: The kernel discipline is used only if the - * offset is less than 0.5 s, as anything higher can lead to - * overflow problems. This might occur if some misguided lad set - * the step threshold to something ridiculous. No problem; use - * the ntp discipline until the residual offset sinks beneath - * the waves. + * step threshold is less than 0.5 s, as anything higher can + * lead to overflow problems. This might occur if some misguided + * lad set the step threshold to something ridiculous. */ - if (pll_control && kern_enable && fabs(clock_offset) < .5 && - state != S_FREQ) { + if (pll_control && kern_enable && clock_max < 0.5) { /* * We initialize the structure for the ntp_adjtime() @@ -794,6 +791,14 @@ adj_host_clock( sys_rootdispersion += clock_phi; #ifndef LOCKCLOCK + /* + * If clock discipline is disabled or if the kernel is enabled, + * get out of Dodge quick. + */ + if (!ntp_enable || mode_ntpdate || (pll_control && + kern_enable && clock_max < 0.5)) + return; + /* * Declare PPS kernel unsync if the pps signal has not been * heard for a few minutes. @@ -805,14 +810,6 @@ adj_host_clock( pps_control = 0; } - /* - * If NTP is disabled or ntpdate mode enabled or the kernel - * discipline is enabled, we have no business going further. - */ - if (!ntp_enable || mode_ntpdate || (pll_control && - kern_enable)) - return; - /* * Implement the phase and frequency adjustments. The gain * factor (denominator) is not allowed to increase beyond the