diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-12-04 17:12:11 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-12-04 17:12:11 +0100 |
commit | 6c46eed6e935db43dedbff1d026e4cf68f0bc67e (patch) | |
tree | f30cae486a4a5515b8a6956b2f128ea927084afa | |
parent | a14958c69da798e2284e8ab29492bdbdd52a2278 (diff) | |
download | busybox-w32-6c46eed6e935db43dedbff1d026e4cf68f0bc67e.tar.gz busybox-w32-6c46eed6e935db43dedbff1d026e4cf68f0bc67e.tar.bz2 busybox-w32-6c46eed6e935db43dedbff1d026e4cf68f0bc67e.zip |
ntpd: comment out "spike detection" code
function old new delta
update_local_clock 982 835 -147
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/ntpd.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c index aeef0431a..f3a4177da 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c | |||
@@ -334,7 +334,7 @@ struct globals { | |||
334 | 334 | ||
335 | #define STATE_NSET 0 /* initial state, "nothing is set" */ | 335 | #define STATE_NSET 0 /* initial state, "nothing is set" */ |
336 | //#define STATE_FSET 1 /* frequency set from file */ | 336 | //#define STATE_FSET 1 /* frequency set from file */ |
337 | #define STATE_SPIK 2 /* spike detected */ | 337 | //#define STATE_SPIK 2 /* spike detected */ |
338 | //#define STATE_FREQ 3 /* initial frequency */ | 338 | //#define STATE_FREQ 3 /* initial frequency */ |
339 | #define STATE_SYNC 4 /* clock synchronized (normal operation) */ | 339 | #define STATE_SYNC 4 /* clock synchronized (normal operation) */ |
340 | uint8_t discipline_state; // doc calls it c.state | 340 | uint8_t discipline_state; // doc calls it c.state |
@@ -1350,11 +1350,15 @@ update_local_clock(peer_t *p) | |||
1350 | * offset exceeds the step threshold and when it does not. | 1350 | * offset exceeds the step threshold and when it does not. |
1351 | */ | 1351 | */ |
1352 | if (abs_offset > STEP_THRESHOLD) { | 1352 | if (abs_offset > STEP_THRESHOLD) { |
1353 | #if 0 | ||
1353 | double remains; | 1354 | double remains; |
1354 | 1355 | ||
1355 | // TODO: this "spike state" seems to be useless, peer selection already drops | 1356 | // This "spike state" seems to be useless, peer selection already drops |
1356 | // occassional "bad" datapoints. If we are here, there were _many_ large offsets - | 1357 | // occassional "bad" datapoints. If we are here, there were _many_ |
1357 | // looks like _our_ clock is off. | 1358 | // large offsets. When a few first large offsets are seen, |
1359 | // we end up in "no valid datapoints, no peer selected" state. | ||
1360 | // Only when enough of them are seen (which means it's not a fluke), | ||
1361 | // we end up here. Looks like _our_ clock is off. | ||
1358 | switch (G.discipline_state) { | 1362 | switch (G.discipline_state) { |
1359 | case STATE_SYNC: | 1363 | case STATE_SYNC: |
1360 | /* The first outlyer: ignore it, switch to SPIK state */ | 1364 | /* The first outlyer: ignore it, switch to SPIK state */ |
@@ -1377,6 +1381,7 @@ update_local_clock(peer_t *p) | |||
1377 | } | 1381 | } |
1378 | /* fall through: we need to step */ | 1382 | /* fall through: we need to step */ |
1379 | } /* switch */ | 1383 | } /* switch */ |
1384 | #endif | ||
1380 | 1385 | ||
1381 | /* Step the time and clamp down the poll interval. | 1386 | /* Step the time and clamp down the poll interval. |
1382 | * | 1387 | * |