From: Harlan Stenn Date: Mon, 20 Jul 2015 07:20:04 +0000 (+0000) Subject: [Bug 2849] Systems with more than one default route may never synchronize. Brian... X-Git-Tag: NTP_4_3_62~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6d46732f8a2f4162c234f7d974cd9c67304ec36;p=thirdparty%2Fntp.git [Bug 2849] Systems with more than one default route may never synchronize. Brian Utterback. bk: 55aca124TS5c5NXoYSxUXesjhKqJbw --- diff --git a/ChangeLog b/ChangeLog index 3f19b77b6..17780ebdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ --- * [Bug 2823] ntpsweep with recursive peers option doesn't work. H.Stenn. +* [Bug 2849] Systems with more than one default route may never + synchronize. Brian Utterback. Note that this patch might need to + be reverted once Bug 2043 has been fixed. * [Bug 2864] 4.2.8p3 fails to compile on Windows. Juergen Perlinger * [Bug 2866] segmentation fault at initgroups(). Harlan Stenn. * [Bug 2867] ntpd with autokey active crashed by 'ntpq -crv'. J.Perlinger diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index 448441715..b4766c032 100644 --- a/ntpd/ntp_peer.c +++ b/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); + } }