]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Dave Mills: Fix an old bug, according to spec.
authorHarlan Stenn <stenn@ntp.org>
Tue, 22 Jul 2003 22:53:07 +0000 (18:53 -0400)
committerHarlan Stenn <stenn@ntp.org>
Tue, 22 Jul 2003 22:53:07 +0000 (18:53 -0400)
bk: 3f1dc053KDVZAZvR1g6ycxfXy4wcmA

ntpd/ntp_proto.c

index 690b4a62275aaf5631238edc0b3ff4e18830f85a..73ca4e71d2da73b43af0ec4a08c2f5aa8599f1ef 100644 (file)
@@ -1593,7 +1593,6 @@ clock_filter(
        peer->filter_offset[j] = sample_offset;
        peer->filter_delay[j] = max(0, sample_delay);
        peer->filter_disp[j] = dsp;
-       peer->filter_epoch[j] = current_time;
        j++; j %= NTP_SHIFT;
        peer->filter_nextpt = (u_short) j;
 
@@ -1607,11 +1606,10 @@ clock_filter(
        dtemp = clock_phi * (current_time - peer->update);
        peer->update = current_time;
        for (i = NTP_SHIFT - 1; i >= 0; i--) {
-               if (i != 0) {
+               if (i != 0)
                        peer->filter_disp[j] += dtemp;
-                       if (peer->filter_disp[j] >= MAXDISPERSE)
-                               peer->filter_disp[j] = MAXDISPERSE;
-               }
+               if (peer->filter_disp[j] >= MAXDISPERSE) 
+                       peer->filter_disp[j] = MAXDISPERSE;
                if (peer->filter_disp[j] >= MAXDISPERSE)
                        dst[i] = MAXDISPERSE;
                else if (peer->update - peer->filter_epoch[j] >
@@ -1622,6 +1620,7 @@ clock_filter(
                ord[i] = j;
                j++; j %= NTP_SHIFT;
        }
+       peer->filter_epoch[j] = current_time;
 
         /*
         * Sort the samples in both lists by distance.