From: Juergen Perlinger Date: Tue, 29 Mar 2016 16:22:03 +0000 (+0200) Subject: [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d516f6fc84942983a51f9adfd9d86632006128f;p=thirdparty%2Fntp.git [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. - Check the initial delay calculation and reject/unpeer the broadcast server if the delay exceeds 50ms. Retry again after the next broadcast packet. bk: 56faababWnuOu3Z_P0x0Xl8BJoxaKw --- diff --git a/ChangeLog b/ChangeLog index c70fe8fc5..c67a28f5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ * [Bug 2994] Systems with HAVE_SIGNALED_IO fail to compile. perlinger@ntp.org * [Bug 2995] Fixes to compile on Windows +* [Bug 3031] ntp broadcastclient unable to synchronize to an server + when the time of server changed. perlinger@ntp.org + - Check the initial delay calculation and reject/unpeer the broadcast + server if the delay exceeds 50ms. Retry again after the next + broadcast packet. --- (4.2.8p6) 2016/01/20 Released by Harlan Stenn diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index ad454099f..43f166f26 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -1958,6 +1958,9 @@ process_packet( peer->aorg = p_xmt; peer->borg = peer->dst; if (t34 < 0 || t34 > 1.) { + /* drop all if in the initial volley */ + if (FLAG_BC_VOL & peer->flags) + goto bcc_init_volley_fail; snprintf(statstr, sizeof(statstr), "offset %.6f delay %.6f", t21, t34); report_event(PEVNT_XERR, peer, statstr); @@ -1983,10 +1986,18 @@ process_packet( * between the unicast timestamp and the broadcast * timestamp. This works for both basic and interleaved * modes. + * [Bug 3031] Don't keep this peer when the delay + * calculation gives reason to suspect clock steps. + * This is assumed for delays > 50ms. */ if (FLAG_BC_VOL & peer->flags) { peer->flags &= ~FLAG_BC_VOL; peer->delay = fabs(peer->offset - p_offset) * 2; + if (peer->delay > 0.05) { + bcc_init_volley_fail: + unpeer(peer); + return; + } } p_del = peer->delay; p_offset += p_del / 2;