From: Harlan Stenn Date: Tue, 22 Jul 2003 22:53:07 +0000 (-0400) Subject: Dave Mills: Fix an old bug, according to spec. X-Git-Tag: NTP_4_2_0~48^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb69664ddac36cd3910569c64b916921150bc417;p=thirdparty%2Fntp.git Dave Mills: Fix an old bug, according to spec. bk: 3f1dc053KDVZAZvR1g6ycxfXy4wcmA --- diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 690b4a6227..73ca4e71d2 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -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.