From 441e42c27625786e25204a4c3ac86a3e038cd16d Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 16 Feb 2010 16:27:56 +0100 Subject: [PATCH] Fix stratum with locked PPS refclock and local stratum --- refclock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/refclock.c b/refclock.c index ddbc075..a419800 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