summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2013-12-04 17:12:11 +0100
committerDenys Vlasenko2013-12-04 17:12:11 +0100
commit6c46eed6e935db43dedbff1d026e4cf68f0bc67e (patch)
treef30cae486a4a5515b8a6956b2f128ea927084afa
parenta14958c69da798e2284e8ab29492bdbdd52a2278 (diff)
downloadbusybox-6c46eed6e935db43dedbff1d026e4cf68f0bc67e.zip
busybox-6c46eed6e935db43dedbff1d026e4cf68f0bc67e.tar.gz
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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index aeef043..f3a4177 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -334,7 +334,7 @@ struct globals {
#define STATE_NSET 0 /* initial state, "nothing is set" */
//#define STATE_FSET 1 /* frequency set from file */
-#define STATE_SPIK 2 /* spike detected */
+//#define STATE_SPIK 2 /* spike detected */
//#define STATE_FREQ 3 /* initial frequency */
#define STATE_SYNC 4 /* clock synchronized (normal operation) */
uint8_t discipline_state; // doc calls it c.state
@@ -1350,11 +1350,15 @@ update_local_clock(peer_t *p)
* offset exceeds the step threshold and when it does not.
*/
if (abs_offset > STEP_THRESHOLD) {
+#if 0
double remains;
-// TODO: this "spike state" seems to be useless, peer selection already drops
-// occassional "bad" datapoints. If we are here, there were _many_ large offsets -
-// looks like _our_ clock is off.
+// This "spike state" seems to be useless, peer selection already drops
+// occassional "bad" datapoints. If we are here, there were _many_
+// large offsets. When a few first large offsets are seen,
+// we end up in "no valid datapoints, no peer selected" state.
+// Only when enough of them are seen (which means it's not a fluke),
+// we end up here. Looks like _our_ clock is off.
switch (G.discipline_state) {
case STATE_SYNC:
/* The first outlyer: ignore it, switch to SPIK state */
@@ -1377,6 +1381,7 @@ update_local_clock(peer_t *p)
}
/* fall through: we need to step */
} /* switch */
+#endif
/* Step the time and clamp down the poll interval.
*