Re: [chrony-dev] NTP packet with valid header but not data

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


I think that the stratum test is needed as that is the only way to prevent
loops (and is I think the main reason for the existence of strata in the first
place.) If you accept a machine whose stratum is larger than ours, you can
have the situation where they get the time from you and you get yours from
them. Now your own stratum should increment to be one greater than theirs, at
which point they do the same, and you rapidly converge to the max stratum, and
sailing off to the land of unconstrained time together. On the other hand,
what happens if they are the only source. So, I am not sure. I would have to
trace through the logic (also looking over my shoulder at what ntpd does since
they have thought about it a lot) to see what the consequences would be.

The other proposal sounds OK, but I really have no gut feeling for it. The question is can chrony recover from a source marked as unreachable, or
does one bad packet mean that source is forever unreachable. That would not be
good. It sounds like one should at least put in an absurd value of the time to
inialise the memory so it will not get used in the selection algorithm (except
then perhaps we can get a case where that is the only source, and chrony uses
that idiotic value).


On Wed, 11 Nov 2009, Miroslav Lichvar wrote:

While investigating a valgrind error about using uninitialized memory
I've noticed something in ntp_core.c I'm not sure is correct.

The source is set as reachable if the packet has a valid header and
samples are pushed to sourcestats if data are valid. If the packet has
only valid header, the source will be set as reachable, but there will
be no data in sourcestats so uninitialized memory will be read in
source selection algorithm.

Is there a reason for this? Or for the other case when only data are
valid? The code seems to be unchanged from the 1st version in CVS. I
think we should use the packet only when both data and header are
valid.

Another (possibly related) thing is that the header is not considered as
valid if stratum > our_stratum.

I'd like to push this patch to git, can anyone please check I'm not
doing something stupid?

Thanks,



--
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@xxxxxxxxxxxxxx
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/

---
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/