Hack to show NTS on ntpq peers

Eric S. Raymond esr at thyrsus.com
Wed Feb 20 14:48:05 UTC 2019


Hal Murray <hmurray at megapathdsl.net>:
> 
> The t column is a "u" for user/client.  (Looks like "l" for refclocks.  It 
> used to be interesting for broadcast and such, but I think you can figure that 
> out from the remote address.)
> 
> We can put 0-8 in that slot to indicate that we are talking to that server 
> with NTS and show the number of cookies remaining.
> 
> I'm not sure how it gets initialized today.  We can put a -1 in there to 
> indicate that it's not running in NTS mode.

Done.  Sort of. I've put all the structure in place in C and Python, but
it looks like the cookie count ntpd is shipping is random bits from
uninitialized memory in the client state block.

To see this, go into ntpq, set debug to 2, then assoc, then do pstats
on a valid assoc number.

The peers display looks OK, so my test to see if a number should be inserted
in the status field is probably busted.  Should be trivial to fix once
ntpd ships the right thing.

Sorry to commit this only 75% finished, but I have to fight a fire.  I'll
have to leave it to you to figure out why that count is garbage.  Peer
blocks are zeroed at allocation time so this is a bit mysterious.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.




More information about the devel mailing list