]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of...
authorJuergen Perlinger <perlinger@ntp.org>
Tue, 29 Mar 2016 16:22:03 +0000 (18:22 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Tue, 29 Mar 2016 16:22:03 +0000 (18:22 +0200)
 - 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

ChangeLog
ntpd/ntp_proto.c

index c70fe8fc563cf0a16def01a652b989e8bc667f06..c67a28f5ed84bbcf5141b9f55476d4c4ba05793f 100644 (file)
--- 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 <stenn@ntp.org>
index ad454099f8b924a16ca84cf3fd162a1d8ab58e61..43f166f26fe5fc96cad5cef0c547bd3421b0f7e9 100644 (file)
@@ -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;