if (debug)
printf(
"newpeer: %s->%s mode %d vers %d poll %d %d flags 0x%x 0x%x ttl %d key %08x\n",
- ntoa(&peer->dstadr->sin), ntoa(&peer->srcadr),
+ stoa(&peer->dstadr->sin), stoa(&peer->srcadr),
peer->hmode, peer->version, peer->minpoll,
peer->maxpoll, peer->flags, peer->cast_flags,
- peer->ttlmax, peer->keyid);
+ peer->ttl, peer->keyid);
#endif
return (peer);
}
*/
if (sys_peer == NULL ||
PKT_TO_STRATUM(pkt->stratum) <
- sys_stratum ||
+ sys_stratum || (sys_cohort &&
+ PKT_TO_STRATUM(pkt->stratum) ==
+ sys_stratum) ||
- rbufp->dstadr->sin.sin_addr.s_addr ==
- pkt->refid)
+ /* XXX How do I check IPv6 addresses ? */
+ (rbufp->dstadr->sin.ss_family == AF_INET &&
+ ((struct sockaddr_in*)&rbufp->dstadr->sin)->sin_addr.s_addr ==
+ pkt->refid))
return;
}
nlist--;
}
- #ifdef OPENSSL
- /*
- * In manycast client mode we may have spooked a sizeable number
- * of peers that we don't need. If there are at least
- * NTP_MINCLOCK of them, the manycast message will be turned
- * off. By the time we get here we nay be ready to prune some of
- * them back, but we want to make sure all the candicates have
- * had a chance. If they didn't pass the sanity and intersection
- * tests, they have already been voted off the island.
- */
- if (sys_survivors >= NTP_MINCLOCK && nlist < NTP_MINCLOCK)
- resetmanycast();
- #endif /* OPENSSL */
- sys_survivors = nlist;
-
- #ifdef DEBUG
- if (debug > 1) {
- for (i = 0; i < nlist; i++)
- printf(
- "select: %s offset %.6f, weight %.6f poll %d\n",
- stoa(&peer_list[i]->srcadr),
- peer_list[i]->offset, synch[i],
- peer_list[i]->pollsw);
- }
- #endif
--
/*
- * What remains is a list of not greater than NTP_MINCLOCK
+ * What remains is a list usually not greater than sys_minclock
* peers. We want only a peer at the lowest stratum to become
* the system peer, although all survivors are eligible for the
* combining algorithm. First record their order, diddle the
io_unsetbclient();
break;
+ /*
+ * Add muliticast group address.
+ */
case PROTO_MULTICAST_ADD:
-
- /*
- * Add muliticast group address
- */
- io_multicast_add(value);
+ io_multicast_add(*svalue);
break;
+ /*
+ * Delete multicast group address.
+ */
case PROTO_MULTICAST_DEL:
-
- /*
- * Delete multicast group address
- */
- io_multicast_del(value);
+ io_multicast_del(*svalue);
break;
+ /*
+ * Set default broadcast delay.
+ */
case PROTO_BROADDELAY:
-
- /*
- * Set default broadcast delay
- */
sys_bdelay = dvalue;
break;