From: Miroslav Lichvar Date: Fri, 18 Dec 2015 14:17:06 +0000 (+0100) Subject: refclock: ignore samples with unsynchronised leap status X-Git-Tag: 2.3-pre1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba81d68b07e6a0ade0c2eef03996a1620315c10c;p=thirdparty%2Fchrony.git refclock: ignore samples with unsynchronised leap status --- diff --git a/refclock.c b/refclock.c index 8791d43d..d995c7ae 100644 --- a/refclock.c +++ b/refclock.c @@ -372,8 +372,6 @@ RCL_AddSample(RCL_Instance instance, struct timeval *sample_time, double offset, !valid_sample_time(instance, sample_time)) return 0; - filter_add_sample(&instance->filter, &cooked_time, offset - correction + instance->offset, dispersion); - switch (leap) { case LEAP_Normal: case LEAP_InsertSecond: @@ -381,10 +379,11 @@ RCL_AddSample(RCL_Instance instance, struct timeval *sample_time, double offset, instance->leap_status = leap; break; default: - instance->leap_status = LEAP_Unsynchronised; - break; + DEBUG_LOG(LOGF_Refclock, "refclock sample ignored bad leap %d", leap); + return 0; } + filter_add_sample(&instance->filter, &cooked_time, offset - correction + instance->offset, dispersion); instance->pps_active = 0; log_sample(instance, &cooked_time, 0, 0, offset, offset - correction + instance->offset, dispersion);