source: MondoRescue/branches/3.3/mindi-busybox/networking/ntpd.diff@ 3667

Last change on this file since 3667 was 3621, checked in by Bruno Cornec, 7 years ago

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

File size: 679 bytes
RevLine 
[3621]1This patch scales down small offsets quadratically. Reduces sensitivity to jitter
2
3diff --git a/networking/ntpd.c b/networking/ntpd.c
4index 4695c33..ac05815 100644
5--- a/networking/ntpd.c
6+++ b/networking/ntpd.c
7@@ -1654,6 +1654,17 @@ update_local_clock(peer_t *p)
8 */
9 if (G.offset_to_jitter_ratio >= TIMECONST_HACK_GATE)
10 tmx.constant--;
11+
12+{
13+ double d = p->lastpkt_delay;
14+ if (d > SLEW_THRESHOLD)
15+ d = SLEW_THRESHOLD;
16+ d /= 2;
17+ if ((abs_offset / d) < 1) {
18+ offset *= (abs_offset / d);
19+ }
20+}
21+
22 tmx.offset = (long)(offset * 1000000); /* usec */
23 if (SLEW_THRESHOLD < STEP_THRESHOLD) {
24 if (tmx.offset > (long)(SLEW_THRESHOLD * 1000000)) {
Note: See TracBrowser for help on using the repository browser.