Refclocks and formatting

Hal Murray hmurray at megapathdsl.net
Mon Apr 17 00:36:21 UTC 2017


ianbruene at gmail.com said:
> In the units project I discovered that the string formatting for  refclocks
> is handled in a completely different manner from the rest of  the code. 

I can't see any reason for refclocks to be different.  There might be one.

At least from ntpmon, it does the same for refclocks and non-refclocks.
                            if ntp.util.PeerSummary.is_clock(retained):
                                dtype = ntp.ntpc.TYPE_CLOCK
                            else:
                                dtype = ntp.ntpc.TYPE_PEER
                            sw = ntp.ntpc.statustoa(dtype,  ...

The ntpq code isn't so simple.  I haven't backtracked through layers of 
procedure calls to see if it really is different for refclocks.


There is another potential worm in this can.  I don't think if it applies to 
this case, but it's worth keeping in mind.

Some of the flags that get decoded come from the kernel sources rather than 
NTP sources.  They are generally the same across OSes and kernel versions, 
but I don't know how to verify that.  I think the clean solution would be to 
decode them on the server.  [Or copy the versions from one kernel to our 
sources and have the build step crash if they are defined in the kernel and 
different.)


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list