From: Miroslav Lichvar Date: Tue, 16 Feb 2010 15:27:56 +0000 (+0100) Subject: Fix stratum with locked PPS refclock and local stratum X-Git-Tag: 1.25-pre1~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=441e42c27625786e25204a4c3ac86a3e038cd16d;p=thirdparty%2Fchrony.git Fix stratum with locked PPS refclock and local stratum --- diff --git a/refclock.c b/refclock.c index ddbc0751..a419800c 100644 --- a/refclock.c +++ b/refclock.c @@ -470,7 +470,8 @@ pps_stratum(RCL_Instance instance, struct timeval *tv) /* Or the current source is another PPS refclock */ for (i = 0; i < n_sources; i++) { - if (refclocks[i].ref_id == ref_id && refclocks[i].pps_rate) + if (refclocks[i].ref_id == ref_id && + refclocks[i].pps_rate && refclocks[i].lock_ref == -1) return stratum - 1; } @@ -508,7 +509,7 @@ poll_timeout(void *arg) offset, dispersion, UTI_TimevalToString(&sample_time)); #endif - if (inst->pps_rate) + if (inst->pps_rate && inst->lock_ref == -1) /* Handle special case when PPS is used with local stratum */ stratum = pps_stratum(inst, &sample_time); else