diff options
Diffstat (limited to 'contrib/ntp/ntpd/ntp_peer.c')
-rw-r--r-- | contrib/ntp/ntpd/ntp_peer.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/ntp/ntpd/ntp_peer.c b/contrib/ntp/ntpd/ntp_peer.c index d42d804..cc23a38 100644 --- a/contrib/ntp/ntpd/ntp_peer.c +++ b/contrib/ntp/ntpd/ntp_peer.c @@ -718,9 +718,13 @@ refresh_all_peerinterfaces(void) /* * this is called when the interface list has changed * give all peers a chance to find a better interface + * but only if either they don't have an address already + * or if the one they have hasn't worked for a while. */ - for (p = peer_list; p != NULL; p = p->p_link) - peer_refresh_interface(p); + for (p = peer_list; p != NULL; p = p->p_link) { + if (!(p->dstadr && (p->reach & 0x3))) // Bug 2849 XOR 2043 + peer_refresh_interface(p); + } } @@ -746,6 +750,8 @@ newpeer( struct peer * peer; u_int hash; + DEBUG_REQUIRE(srcadr); + #ifdef AUTOKEY /* * If Autokey is requested but not configured, complain loudly. @@ -764,7 +770,7 @@ newpeer( /* * For now only pool associations have a hostname. */ - NTP_INSIST(NULL == hostname || (MDF_POOL & cast_flags)); + INSIST(NULL == hostname || (MDF_POOL & cast_flags)); /* * First search from the beginning for an association with given @@ -817,6 +823,7 @@ newpeer( if (peer_free_count == 0) getmorepeermem(); UNLINK_HEAD_SLIST(peer, peer_free, p_link); + INSIST(peer != NULL); peer_free_count--; peer_associations++; if (FLAG_PREEMPT & flags) |