[ntp:bk-ntp-dev-send] BitKeeper diffs

Harlan Stenn stenn at deacon.udel.edu
Thu Sep 30 04:51:26 UTC 2010


#### ChangeSet ####
2010-09-30 00:50:30-04:00, stenn at deacon.udel.edu 
  Clock select bugfix from Dave Mills.
  [Bug 1554]: peer may stay selected as system peer after becoming
  unreachable.

==== ChangeLog ====
2010-09-30 00:43:09-04:00, stenn at deacon.udel.edu +3 -0
  Clock select bugfix from Dave Mills.
  [Bug 155]: peer may stay selected as system peer after becoming
  unreachable.

--- 1.650/ChangeLog	2010-09-30 00:25:41 -04:00
+++ 1.651/ChangeLog	2010-09-30 00:43:09 -04:00
@@ -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 at ntp.org>

==== ntpd/ntp_proto.c ====
2010-09-30 00:43:09-04:00, stenn at deacon.udel.edu +10 -3
  Clock select bugfix from Dave Mills.
  [Bug 155]: peer may stay selected as system peer after becoming
  unreachable.

--- 1.303/ntpd/ntp_proto.c	2010-09-25 13:39:41 -04:00
+++ 1.304/ntpd/ntp_proto.c	2010-09-30 00:43:09 -04:00
@@ -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


More information about the bk-ntp-dev-send mailing list