Progress, and a puzzle.

Eric S. Raymond esr at thyrsus.com
Thu Nov 3 17:47:44 UTC 2016


The Python translation of ntpq is done, modulo one minor feature in
mrulist that I expect to have up later today.  All commands, including
the authenticated ones, are working.

The translation has turned up a weird bug in ntpd, however.  It turns out that
in two mode 6 responses, reslist and ifstats, ntpd frequently sends bursts
of binary garbage in the middle of what is otherwise good textual data.  There
is a perhaps related problem, much less frequent, with extra NULs being sent
after value strings in MRU-list responses.

This was hard to notice in C ntpq because it did a whole bunch of validation
and consistency checks on the responses and plain threw out any records that
looked hinky.  The Python port has a different philosophy; it tries to mess
with the data that ntpd is shipping as little as possible and to fill in
displays of corrupted data with '?'.

Before I pull the big switch and drop the C ntpq code I'm going to try
to track down this ntpd problem.

For those of you interested, Mode 6 is now fully documented at
docs/mode6.txt.  It's a strange piece of design - very nearly excellent,
but with a bunch of inconsistencies and odd glitches that spoil the
effect.

One wonders, for example, why exactly one response (readstats) has a
binary payload, but all others use a common textual format.  Mills,
or whoever designed it, seems to have been groping towards something
like JSON.  But the protocol is not consistent about whether or
how text payloads are terminated, and has the odd misfeature that instead
of writing foo="" to set a response variable to the empty string, yo
just say foo (the bare name) and the following ="" is assumed.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>


More information about the devel mailing list