* to it. If something goes wrong, carefully pry the new
* association away and return its marbles to the candy
* store.
- */
+ */
peer = newpeer(&rbufp->recv_srcadr, rbufp->dstadr,
MODE_CLIENT, PKT_VERSION(pkt->li_vn_mode),
NTP_MINDPOLL, NTP_MAXDPOLL, 0, skeyid);
break;
peer->flags |= FLAG_MCAST1 | FLAG_MCAST2 | FLAG_BURST;
peer->hmode = MODE_CLIENT;
+
+ /*
+ * Crank up the resolver to fetch the canonical name and
+ * hope it lands before the protocol gets wound up.
+ */
+
+printf("bcst resolve %08x, %d\n", peer->srcadr.sin_addr.s_addr,
+ peer->associd);
+
+ ntp_res_send(NULL, NULL, peer->srcadr.sin_addr.s_addr,
+ peer->associd);
break;
case AM_POSSBCL:
* Compute the offset, delay, variance (squares) and error
* bound. The offset, delay and variance are weighted by the
* reciprocal of distance and normalized. The error bound is
- * weighted exponentially.
+ * weighted exponentially. When no acceptable samples remain in
+ * the shift register, quietly tiptoe home.
*/
off = dly = var = dsp = dtemp = 0;
for (i = NTP_SHIFT - 1; i >= 0; i--) {
SQUARE(distance[i]);
}
}
+ if (dtemp == 0)
+ return;
peer->delay = dly / dtemp;
peer->variance = min(var / SQUARE(dtemp), MAXDISPERSE);
peer->disp = min(dsp, MAXDISPERSE);
}
#endif
+ /* check out auth stuff */
+ if (sys_authenticate) {
+ if (!authistrusted(req_keyid)) {
+ msyslog(LOG_ERR, "invalid request keyid %08x",
+ req_keyid );
+ exit(1);
+ }
+ }
+
/*
* Make a first cut at resolving the bunch
*/