Re: [chrony-dev] [PATCH] enable stratum setting for refclocks (take 2)

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Thu, Oct 05, 2017 at 09:42:10PM +0200, Andreas Steinmetz wrote:
> > Does this really need a new SRC parameter? I'd prefer if this was an
> > option specific to refclocks and it just changed the stratum that is
> > passed with the refclock sample.
> > 
> 
> Now no new SRC parameter, but a new SRC function. The problem is that
> the required access to the structure to set the refclock stratum for
> SRC is only available to SRC.

Maybe I'm missing some detail, but why not just change the value
passed to SRC_AccumulateSample in refclock.c?

--- a/refclock.c
+++ b/refclock.c
@@ -635,7 +635,7 @@ poll_timeout(void *arg)
         /* Handle special case when PPS is used with local stratum */
         stratum = pps_stratum(inst, &sample_time);
       else
-        stratum = 0;
+        stratum = inst->stratum;
 
       SRC_UpdateReachability(inst->source, 1);
       SRC_AccumulateSample(inst->source, &sample_time, offset,


-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/