From: Harlan Stenn Date: Thu, 17 May 2001 05:38:23 +0000 (-0000) Subject: Many files: X-Git-Tag: NTP_4_0_99_M~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7788402b230feb63369b0b92e15f395104066b7;p=thirdparty%2Fntp.git Many files: * configure.in: 4.0.99k37 * ntpd/ntp_proto.c (clock_filter): Lose "off", xtemp and ytemp, and some obsoleted calculations. Set the peer->offset and peer->delay from the filter stages. * ntpd/ntp_loopfilter.c: Comment/document improvements. (local_clock): correct the offset by one-half the difference between the sample delay and minimum delay. Lose "mu" from the debug message. From: Dave Mills. bk: 3b0363cfiryrY9QEyzJx1V5-MQg9Ag --- diff --git a/ChangeLog b/ChangeLog index 619926bc7..9fb59cda2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2001-05-17 Harlan Stenn + + * configure.in: 4.0.99k37 + + * ntpd/ntp_proto.c (clock_filter): Lose "off", xtemp and ytemp, + and some obsoleted calculations. Set the peer->offset and + peer->delay from the filter stages. + + * ntpd/ntp_loopfilter.c: Comment/document improvements. + (local_clock): correct the offset by one-half the difference + between the sample delay and minimum delay. Lose "mu" from the + debug message. + From: Dave Mills. + 2001-05-15 Harlan Stenn * configure.in: 4.0.99k36 diff --git a/configure b/configure index b6dac7edd..b3c1333f3 100755 --- a/configure +++ b/configure @@ -1377,7 +1377,7 @@ fi # Define the identity of the package. PACKAGE=ntp -VERSION=4.0.99k36 +VERSION=4.0.99k37 cat >>confdefs.h < clock_panic && clock_panic > 0 && !allow_panic) { msyslog(LOG_ERR, - "time error %.0f over %.0f seconds; set clock manually", + "time error %.0f exceeds %.0f seconds; set clock manually", fp_offset, clock_panic); return (-1); } @@ -247,6 +248,9 @@ local_clock( * slewed. The value defaults to 128 ms, but can be set to even * unreasonable values. If set to zero, the clock will never be * stepped. + * + * Note that if ntpdate is active, the terminal does not detach, + * so the termination comments print directly to the console. */ if (mode_ntpdate) { if (allow_step && fabs(fp_offset) > clock_max && @@ -292,7 +296,7 @@ local_clock( /* * The huff-n'-puff filter finds the lowest delay in the recent - * path. This is used to correct the offset by one-half the + * interval. This is used to correct the offset by one-half the * difference between the sample delay and minimum delay. This * is most effective if the delays are highly assymetric and * clockhopping is avoided and the clock frequency wander is @@ -305,9 +309,9 @@ local_clock( if (sys_mindly == 0 || peer->delay < sys_mindly) sys_mindly = peer->delay; if (fp_offset > 0) - dtemp = -(peer->delay - sys_mindly); + dtemp = -(peer->delay - sys_mindly) / 2; else - dtemp = peer->delay - sys_mindly; + dtemp = (peer->delay - sys_mindly) / 2; fp_offset += dtemp; #ifdef DEBUG if (debug) @@ -323,7 +327,7 @@ local_clock( * and frequency errors. There are two main regimes: when the * offset exceeds the step threshold and when it does not. * However, if the step threshold is set to zero, a step will - * never occur. See your instruction manual for the details how + * never occur. See the instruction manual for the details how * these actions interact with the command line options. */ retval = 0; @@ -670,14 +674,13 @@ local_clock( if ((peer->flags & FLAG_REFCLOCK) == 0 && dtemp < MINDISPERSE) dtemp = MINDISPERSE; sys_rootdispersion = peer->rootdispersion + dtemp; - record_loop_stats(last_offset, drift_comp, sys_jitter, - clock_stability, sys_poll); + record_loop_stats(last_offset, drift_comp, sys_jitter, + clock_stability, sys_poll); #ifdef DEBUG if (debug > 1) printf( - "local_clock: mu %.0f fadj %.3f fll %.3f pll %.3f\n", - mu, clock_frequency * 1e6, flladj * 1e6, plladj * - 1e6); + "local_clock: fadj %.3f fll %.3f pll %.3f\n", + clock_frequency * 1e6, flladj * 1e6, plladj * 1e6); #endif /* DEBUG */ #ifdef DEBUG if (debug) diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 752630980..ef73bbbc2 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -1307,7 +1307,7 @@ clock_filter( double dst[NTP_SHIFT]; /* distance vector */ int ord[NTP_SHIFT]; /* index vector */ register int i, j, k, m; - double off, dly, dsp, jit, dtemp, etemp, ftemp; + double dsp, jit, dtemp, etemp, ftemp; /* * Shift the new sample into the register and discard the oldest @@ -1397,12 +1397,11 @@ clock_filter( * the shift register, quietly tiptoe home leaving only the * dispersion. */ - off = dly = jit = dtemp = 0; + jit = 0; peer->disp = 0; k = ord[0]; m = 0; for (i = NTP_SHIFT - 1; i >= 0; i--) { - double xtemp, ytemp; j = ord[i]; peer->disp = NTP_FWEIGHT * (peer->disp + @@ -1410,21 +1409,8 @@ clock_filter( if (dst[i] >= MAXDISTANCE) continue; m++; - xtemp = 2 * fabs(peer->filter_offset[j] - - peer->filter_offset[k]); - ytemp = max(peer->filter_delay[j] - - peer->filter_delay[k], dsp); - etemp = max(dsp, 1. - xtemp / ytemp); - dtemp += etemp; - off += peer->filter_offset[j] * etemp; - dly += peer->filter_delay[j] * etemp; jit += DIFF(peer->filter_offset[j], peer->filter_offset[k]); -#ifdef DEBUG - if (debug > 1) - printf("clock_filter: %d %.6f %.6f %.6f\n", - j, xtemp, ytemp, etemp); -#endif } /* @@ -1436,8 +1422,8 @@ clock_filter( if (m == 0) return; etemp = peer->offset; - peer->offset = off / dtemp; - peer->delay = dly / dtemp; + peer->offset = peer->filter_offset[k]; + peer->delay = peer->filter_delay[k]; if (m > 1) jit /= m - 1; peer->jitter = max(jit, SQUARE(LOGTOD(sys_precision)));