]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Clock select bugfix from Dave Mills.
authorHarlan Stenn <stenn@ntp.org>
Thu, 30 Sep 2010 04:50:30 +0000 (00:50 -0400)
committerHarlan Stenn <stenn@ntp.org>
Thu, 30 Sep 2010 04:50:30 +0000 (00:50 -0400)
[Bug 1554]: peer may stay selected as system peer after becoming
unreachable.

bk: 4ca417168-tmfpB_FkaeZJt1d-QtmA

ChangeLog
ntpd/ntp_proto.c

index e5693f217fb51e3dcc2424038c494bfaa66c0cdb..71e2744311a8128ac2113b33df34788dcdb69d5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+* Clock select bugfix from Dave Mills.
+* [Bug 1554]: peer may stay selected as system peer after becoming
+  unreachable.
 * [Bug 1644] from 4.2.6p3: cvo.sh should use lsb_release to identify
   linux distros.
 (4.2.7p57) 2010/09/27 Released by Harlan Stenn <stenn@ntp.org>
index 13ff64947a4fc54609d39ae703c41a681aac87fc..82355740aeeb2bbe3d219001c0c7ec68785ad2fa 100644 (file)
@@ -2187,8 +2187,10 @@ clock_filter(
         * save the offset, delay and jitter. Note the jitter must not
         * be less than the precision.
         */
-       if (m == 0)
+       if (m == 0) {
+               clock_select();
                return;
+       }
 
        etemp = fabs(peer->offset - peer->filter_offset[k]);
        peer->offset = peer->filter_offset[k];
@@ -2477,6 +2479,7 @@ clock_select(void)
                                found++;
                }
 
+#if 0
                /*
                 * If the number of candidates found outside the
                 * interval is greater than the number of falsetickers,
@@ -2486,6 +2489,7 @@ clock_select(void)
                 */
                if (found > allow)
                        continue;
+#endif
 
                /*
                 * If an interval containing truechimers is found, stop.
@@ -2506,9 +2510,12 @@ clock_select(void)
         */
        j = 0;
        for (i = 0; i < nlist; i++) {
+               double  d;
+
                peer = peers[i];
-               if (nlist > 1 && (peer->offset <= low || peer->offset >=
-                   high) && !(peer->flags & FLAG_TRUE))
+               d = root_distance(peer);
+               if (nlist > 1 && (peer->offset + d < low ||
+                   peer->offset - d > high) && !(peer->flags & FLAG_TRUE))
                        continue;
 
 #ifdef REFCLOCK