Progress, and a puzzle.

Eric S. Raymond esr at thyrsus.com
Thu Nov 3 21:38:55 UTC 2016


Hal Murray <hmurray at megapathdsl.net>:
> > One wonders, for example, why exactly one response (readstats) has a binary
> > payload
> 
> My guess is history.  It's probably left over from before the mode6/mode7 
> stuff got sorted out and Mills decided that mode6 should be all text.

That seems plausible.

> You could fix that.  I'd probably wait until there is a good reason to add 
> another command.

As Mark says, I think we're stuck with being interoperable with old
versions.

The problems with the design of Mode 6 are annoying in a minor way,
but nowhere near bad enough to merit a flag day.  I'll just seal it
all off behind a Python interface class and suppress any urge to fix
non-bugs.

> > 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.
> 
> That's probably a bug.

Considering that the binary crap erupts in the middle of tag names and value
literals, yes.  You get stuff that looks like "fl!@$%*ags", only with even less
friemdly characters.

> One of the complicated responses sends the slots within a line in random 
> order and adds a garbage field name and value.  The comment said it was to 
> keep the client side from making assumptions that would turn into constraints 
> on the server side.  I think it's reslist.

First thing I checked.  If you disable the random tags (which are
generated with all-ASCII names) you still get binary eruptions.

ifstats also does frequent random-tag sends. And has binary tumors, though
less often.

> How are you testing things?

Try running pyntpq in the ntpq directory.  That's an ntp symlink to the
source-tree location of the libries it needs.

> I tried installing, but there is no pyntpq on my search path and I don't see 
> it actually getting installed.

In the present state of things, the Python ntp library is part of the
normal install to rootspace, but pyntpq is not.  That will change when
it replaces the C version, but because of a requirement from a
potential funder I first need to verify that I can compile pyntpq to
a binary that doesn't have a runtime Python dependency.

> After installing, I get this:
> $ ./ntpq/pyntpq
> Traceback (most recent call last):
>   File "./ntpq/pyntpq", line 18, in <module>
>     from ntp.util import *
>   File "/home/murray/ntpsec/play/ntpq/ntp/util.py", line 9, in <module>
>     import ntp.ntpc
> ImportError: No module named ntpc
> $

As I said, run it from ntpq/ for now.  I'll clean all this up shortly.

Had you noticed that the peers display resizes horizontally to fit a
wide terminal emulator?  Leaves more room for hostnames.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>


More information about the devel mailing list