[ntp:questions] Panic threshold code

Harlan Stenn stenn at ntp.org
Tue Nov 19 08:54:39 UTC 2013

A C writes:
> If I'm reading the code correctly (for 4.2.7p270 at the moment), in
> ntp_loopfilter.c at line 245 (or nearby for newer versions) I see:
> if (fabs(fp_offset) > clock_panic && clock_panic > 0 && !allow_panic) {
>        snprintf(tbuf, sizeof(tbuf),
>           "%+.0f s; set clock manually within %.0f s.",
>            fp_offset, clock_panic);
>        report_event(EVNT_SYSFAULT, NULL, tbuf);
>        return (-1);
> }
> I am assuming this is the segment of code that will cause ntpd to abort
> entirely if the panic threshold (default 1000 s) is exceeded?

Yes.  And the value can be changed (0 means "don't exit if the offset is
huge") and one can start ntpd with -g to wiggle allow_panic to let the
first adjustment happen regardless of how big it is.
Harlan Stenn <stenn at ntp.org>
http://networktimefoundation.org - be a member!

More information about the questions mailing list