mirror of
https://github.com/sheumann/hush.git
synced 2024-07-07 10:28:56 +00:00
ntpd: let user know if spike was detected
function old new delta update_local_clock 861 943 +82 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
327f550669
commit
cb1dc1d1d1
@ -1347,10 +1347,12 @@ update_local_clock(peer_t *p)
|
|||||||
* offset exceeds the step threshold and when it does not.
|
* offset exceeds the step threshold and when it does not.
|
||||||
*/
|
*/
|
||||||
if (abs_offset > STEP_THRESHOLD) {
|
if (abs_offset > STEP_THRESHOLD) {
|
||||||
|
double remains;
|
||||||
|
|
||||||
switch (G.discipline_state) {
|
switch (G.discipline_state) {
|
||||||
case STATE_SYNC:
|
case STATE_SYNC:
|
||||||
/* The first outlyer: ignore it, switch to SPIK state */
|
/* The first outlyer: ignore it, switch to SPIK state */
|
||||||
VERB3 bb_error_msg("offset:%+f - spike detected", offset);
|
VERB2 bb_error_msg("offset:%+f - spike", offset);
|
||||||
G.discipline_state = STATE_SPIK;
|
G.discipline_state = STATE_SPIK;
|
||||||
return -1; /* "decrease poll interval" */
|
return -1; /* "decrease poll interval" */
|
||||||
|
|
||||||
@ -1358,9 +1360,10 @@ update_local_clock(peer_t *p)
|
|||||||
/* Ignore succeeding outlyers until either an inlyer
|
/* Ignore succeeding outlyers until either an inlyer
|
||||||
* is found or the stepout threshold is exceeded.
|
* is found or the stepout threshold is exceeded.
|
||||||
*/
|
*/
|
||||||
if (since_last_update < WATCH_THRESHOLD) {
|
remains = WATCH_THRESHOLD - since_last_update;
|
||||||
VERB3 bb_error_msg("spike detected, datapoint ignored, %f sec remains",
|
if (remains > 0) {
|
||||||
WATCH_THRESHOLD - since_last_update);
|
VERB2 bb_error_msg("spike, datapoint ignored, %f sec remains",
|
||||||
|
remains);
|
||||||
return -1; /* "decrease poll interval" */
|
return -1; /* "decrease poll interval" */
|
||||||
}
|
}
|
||||||
/* fall through: we need to step */
|
/* fall through: we need to step */
|
||||||
|
Loading…
Reference in New Issue
Block a user