diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-03-04 07:36:04 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-03-04 07:36:04 +0100 |
commit | aee7cd82be31577c2e5c144d083af206bedbb96a (patch) | |
tree | ca0fe0bcb0274a44a755f558ea5257870dbd1ff5 | |
parent | c8641962e4cbde48108ddfc1c105e3320778190d (diff) | |
download | busybox-w32-aee7cd82be31577c2e5c144d083af206bedbb96a.tar.gz busybox-w32-aee7cd82be31577c2e5c144d083af206bedbb96a.tar.bz2 busybox-w32-aee7cd82be31577c2e5c144d083af206bedbb96a.zip |
ntpd: add experimental patch
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/ntpd.diff | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/networking/ntpd.diff b/networking/ntpd.diff new file mode 100644 index 000000000..4afd7e134 --- /dev/null +++ b/networking/ntpd.diff | |||
@@ -0,0 +1,24 @@ | |||
1 | This patch scales down small offsets quadratically. Reduces sensitivity to jitter | ||
2 | |||
3 | diff --git a/networking/ntpd.c b/networking/ntpd.c | ||
4 | index 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)) { | ||