]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Many files:
authorHarlan Stenn <stenn@ntp.org>
Thu, 17 May 2001 05:38:23 +0000 (05:38 -0000)
committerHarlan Stenn <stenn@ntp.org>
Thu, 17 May 2001 05:38:23 +0000 (05:38 -0000)
  * 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

ChangeLog
configure
configure.in
ntpd/ntp_loopfilter.c
ntpd/ntp_proto.c

index 619926bc73804fdcb82e0505649f4d3e23a18dd4..9fb59cda29bec5ea5b32e7bc5d64a1601fb4573a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-05-17  Harlan Stenn  <stenn@whimsy.udel.edu>
+
+       * 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  <stenn@whimsy.udel.edu>
 
        * configure.in: 4.0.99k36
index b6dac7edd58c98ea31d31b7f763dfe1e20ea3c7c..b3c1333f3b8d55e3bdab5177473074651851716d 100755 (executable)
--- 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 <<EOF
 #define PACKAGE "$PACKAGE"
index 1621738b406856a02e2fc129d4af93dc05f81b9d..6e9d1e34be542e35c55bdf4d2c5aad3b9ce1ba4f 100644 (file)
@@ -5,7 +5,7 @@ AC_CANONICAL_SYSTEM
 AC_DEFINE_UNQUOTED(STR_SYSTEM, "$target")
 AM_CONFIG_HEADER(config.h)
 AC_ARG_PROGRAM
-AM_INIT_AUTOMAKE(ntp, 4.0.99k36)
+AM_INIT_AUTOMAKE(ntp, 4.0.99k37)
 AC_PREREQ(2.49)
 
 ac_cv_var_oncore_ok=no
index e9b1dcdeb7c0e1a93a64cf814253d71ada7103b0..681438bf36600b38c9e71a05fcf0ce33a984fd61 100644 (file)
@@ -228,14 +228,15 @@ local_clock(
         * If the clock is way off, panic is declared. The clock_panic
         * defaults to 1000 s; if set to zero, the panic will never
         * occur. The allow_panic defaults to FALSE, so the first panic
-        * will exit. It can be set TRUE by a command line option, but
-        * it will be set it FALSE when the update is within the step
-        * range; so, subsequent panics will exit.
+        * will exit. It can be set TRUE by a command line option, in
+        * which case the clock will be set anyway and time marches on.
+        * But, allow_panic will be set it FALSE when the update is
+        * within the step range; so, subsequent panics will exit.
         */
        if (fabs(fp_offset) > 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)
index 752630980f01f22a016ae8da6af78bd583941d7f..ef73bbbc220fe9fd530a8d7e1b84e977f2f3f8ff 100644 (file)
@@ -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)));