Re: ntp.c : possible inconsistency?
From: Roman Zippel
Date: Mon Jan 15 2007 - 07:44:02 EST
Hi,
On Wed, 10 Jan 2007, Bernhard Schiffner wrote:
> > Without a further explanation of this craziness, it's a little hard to
> > discuss...
> Let's try it:
> time_constant is created for internal use of ntp.c and added by 4
> - time_constant = min(txc->constant + 4, (long)MAXTC);
> + time_constant = min(txc->constant + 4, (long)MAXTC + 4);
MAXTC is already adjusted.
> But sometimes it is written back to data referenced from outside. So let's do
> the + 4 backwards ...
> - txc->constant = time_constant;
> + txc->constant = time_constant - 4;
ntpd doesn't read it back for it's own purposes, it only prints it, when
the kernel info is queried, it doesn't adjust the constant there, so I
didn't do it in the kernel either.
bye, Roman