* [Bug 2069] from 4.2.6p5-RC2: broadcastclient, multicastclient spin up
duplicate ephemeral associations without broadcastdelay.
* from 4.2.6p5-RC2: Exclude not-yet-determined sys_refid from use in
- loopback TEST12 (from David Mills).
+ loopback TEST12 (from Dave Mills).
+* Restore 4.2.6 clock_combine() weighting to ntp-dev, reverting to pre-
+ 4.2.7p70 logic and avoiding divide-by-zero (from Dave Mills).
(4.2.7p236) 2011/11/16 Released by Harlan Stenn <stenn@ntp.org>
* Documentation updates from Dave Mills.
(4.2.7p235) 2011/11/16 Released by Harlan Stenn <stenn@ntp.org>
}
-/*
- * clock_combine - compute system offset and jitter from selected peers
- */
static void
clock_combine(
struct peer **peers, /* survivor list */
)
{
int i;
- double x, y, z, w;
+ double d, x, y, z, w;
y = z = w = 0;
for (i = 0; i < npeers; i++) {
- x = max(sys_maxdist - root_distance(peers[i]), sys_mindisp);
+ d = root_distance(peers[i]);
+ if (0. == d)
+ d = 1e-6; /* hart avoid div by 0 */
+ x = 1. / d;
y += x;
z += peers[i]->offset * x;
w += SQUARE(peers[i]->offset - peers[0]->offset) * x;