[ntp:questions] ntpd/refclock_local.c

unruh unruh at wormhole.physics.ubc.ca
Fri Aug 6 03:41:21 UTC 2010

On 2010-08-05, mval <mjjunk19 at gmail.com> wrote:
> Upgrading ntp from 4.2.0 to 4.2.6p1.
> System receives time via broadcast over the wildcard interface.
> Everything is working correctly after the upgrade; system first syncs
> with local clock, then receives broadcast and syncs with it.
> In version 4.2.0, if the broadcast server went down, ntpd would resync
> with the local time until the broadcast server came back up (the
> transition took approximately 6 minutes).  In 4.2.6p1, if the
> broadcast server goes down, ntpd never re-syncs with the local time.
> A ntpq -p reports that the LOCAL can still be seen, but ntpd does not
> report that it has synced with it.
> This is an issue because this client acts as a server for other
> systems that are downstream.
> I did some digging, and found that there are two lines of code that
> cause my issue and are located in ntpd/refclock_lcoal.c:
> /*
>  * Do no evil unless the house is dark or lit with our own lamp.
>  */
> if(!(sys_peer == NULL || sys_peer == peer))
>     return;

Ssurely it is thelines of code after that that are important. They are
run only if sys_peer == NULL || sys_peer == peer. It would be surprizing
if removing these lines did something good, since they sto pthe
following code from being run usually, and now you run it usually.

> If I comment these two lines of code out, 4.2.6p1 functions exactly
> the same as 4.2.0.  I was hoping someone could tell me if there is any
> documentation regarding when/why these lines of code were added and if
> commenting these two lines of code out effects the rest of NTP in an
> unfavorable way.
> I appreciate any help.  Please let me know if there is any other
> information required.
> Regards,
> mval

More information about the questions mailing list