+* ntp_proto.c: sys_survivors and hpoll cleanup from Dave Mills.
+* ntp_loopfilter.c: sys_poll cleanup from Dave Mills.
* refclock_wwv.c: maximum-likelihood digit and DSYNC fixes from Dave Mills.
* [Bug 967] preemptable associations are lost forever on a step.
* ntp_config.c: [CID 48] missing "else" clause.
* than 0.5 s.
*/
osys_poll = sys_poll;
+ if (sys_poll < peer->minpoll)
+ sys_poll = peer->minpoll;
+ if (sys_poll > peer->maxpoll)
+ sys_poll = peer->maxpoll;
clock_epoch += mu;
clock_frequency = flladj = plladj = 0;
rval = 1;
} else {
/*
- * The offset is less than the step threshold. Clamp the
- * poll update to the current peer. Calculatethe jitter
- * as the exponentially weighted offset
+ * The offset is less than the step threshold. Calculate
+ * the jitter as the exponentially weighted offset
* differences.
*/
- if (sys_poll < peer->minpoll)
- sys_poll = peer->minpoll;
- if (sys_poll > peer->maxpoll)
- sys_poll = peer->maxpoll;
etemp = SQUARE(clock_jitter);
dtemp = SQUARE(max(fabs(fp_offset - last_offset),
LOGTOD(sys_precision)));
* is intricate...
*/
hpoll = peer->hpoll;
+
/*
* In broadcast mode the poll interval is never changed from
* minpoll.
* Here the peer is reachable. Send a burst if
* enabled and the peer is fit.
*/
+ hpoll = sys_poll;
if (!oreach || !(peer->flags & FLAG_PREEMPT))
peer->unreach = 0;
if (peer->flags & FLAG_BURST && peer->retry ==
* poll_update() routine will clamp it to maxpoll.
*/
if (peer->unreach >= NTP_UNREACH) {
- if (peer->flags & FLAG_PREEMPT) {
+ if (peer->flags & FLAG_PREEMPT &&
+ sys_survivors >= sys_maxclock) {
peer_clear(peer, "TIME");
unpeer(peer);
return;
peer_clear(peer, "TIME");
peer->unreach = 0;
}
- hpoll++;
#endif /* OPENSSL */
+ hpoll++;
}
}
} else {
* If the the new sample and the current sample are both valid
* and the difference between their offsets exceeds CLOCK_SGATE
* (3) times the jitter and the interval between them is less
- * than twice the system poll interval, consider the new sample
+ * than twice the host poll interval, consider the new sample
* a popcorn spike and ignore it.
*/
if (peer->disp < sys_maxdist && peer->filter_disp[k] <
sys_maxdist && etemp > CLOCK_SGATE * peer->jitter &&
peer->filter_epoch[k] - peer->epoch < 2. *
- ULOGTOD(sys_poll)) {
+ ULOGTOD(peer->hpoll)) {
#ifdef DEBUG
if (debug)
printf("clock_filter: popcorn %.6f %.6f\n",
/*
* A distance error for a remote peer occurs if the root
* distance is greater than or equal to the distance threshold
- * plus the increment due to one poll interval.
+ * plus the increment due to one host poll interval.
*/
if (!(peer->flags & FLAG_REFCLOCK) && root_distance(peer) >=
- sys_maxdist + clock_phi * ULOGTOD(sys_poll))
+ sys_maxdist + clock_phi * ULOGTOD(peer->hpoll))
rval |= TEST11; /* distance exceeded */
/*