diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-07-02 16:17:07 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-07-02 16:18:34 +0200 |
commit | 029bd187bdad5bfd7771ed356e633e8ec8044d2e (patch) | |
tree | 7fdd8faa810296748e45b6a621c104360cb1f1ba | |
parent | 0dbcb46af50ab273e03f3a6e4ae93912aa1f2f35 (diff) | |
download | busybox-w32-029bd187bdad5bfd7771ed356e633e8ec8044d2e.tar.gz busybox-w32-029bd187bdad5bfd7771ed356e633e8ec8044d2e.tar.bz2 busybox-w32-029bd187bdad5bfd7771ed356e633e8ec8044d2e.zip |
ntpd: increase minimum G.FREQHOLD_cnt from 8 to 10
With ~0.9 initiall offsets, using 8 results in a bit too eager
frequency correction.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/ntpd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c index a1b8ac5b0..7b800369e 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c | |||
@@ -149,6 +149,7 @@ | |||
149 | */ | 149 | */ |
150 | 150 | ||
151 | #define INITIAL_SAMPLES 4 /* how many samples do we want for init */ | 151 | #define INITIAL_SAMPLES 4 /* how many samples do we want for init */ |
152 | #define MIN_FREQHOLD 10 /* adjust offset, but not freq in this many first adjustments */ | ||
152 | #define BAD_DELAY_GROWTH 4 /* drop packet if its delay grew by more than this */ | 153 | #define BAD_DELAY_GROWTH 4 /* drop packet if its delay grew by more than this */ |
153 | 154 | ||
154 | #define RETRY_INTERVAL 32 /* on send/recv error, retry in N secs (need to be power of 2) */ | 155 | #define RETRY_INTERVAL 32 /* on send/recv error, retry in N secs (need to be power of 2) */ |
@@ -1753,7 +1754,7 @@ update_local_clock(peer_t *p) | |||
1753 | //15:19:39.114 update from:<IP> offset:+0.327022 delay:0.158384 jitter:0.108538 clock drift:-1.393ppm tc:4 | 1754 | //15:19:39.114 update from:<IP> offset:+0.327022 delay:0.158384 jitter:0.108538 clock drift:-1.393ppm tc:4 |
1754 | //15:20:12.715 update from:<IP> offset:+0.275596 delay:0.158297 jitter:0.097292 clock drift:-1.393ppm tc:4 | 1755 | //15:20:12.715 update from:<IP> offset:+0.275596 delay:0.158297 jitter:0.097292 clock drift:-1.393ppm tc:4 |
1755 | //15:20:45.111 update from:<IP> offset:+0.225715 delay:0.158271 jitter:0.087841 clock drift:-1.393ppm tc:4 | 1756 | //15:20:45.111 update from:<IP> offset:+0.225715 delay:0.158271 jitter:0.087841 clock drift:-1.393ppm tc:4 |
1756 | // If allwed to continue, it would start increasing tmx.freq now. | 1757 | // If allowed to continue, it would start increasing tmx.freq now. |
1757 | // Instead, it was ^Ced, and started anew: | 1758 | // Instead, it was ^Ced, and started anew: |
1758 | //15:21:15.043 no valid datapoints, no peer selected | 1759 | //15:21:15.043 no valid datapoints, no peer selected |
1759 | //15:21:17.408 update from:<IP> offset:+0.175910 delay:0.158314 jitter:0.076683 clock drift:-1.393ppm tc:4 | 1760 | //15:21:17.408 update from:<IP> offset:+0.175910 delay:0.158314 jitter:0.076683 clock drift:-1.393ppm tc:4 |
@@ -1776,9 +1777,9 @@ update_local_clock(peer_t *p) | |||
1776 | //15:31:53.473 update from:<IP> offset:+0.000007 delay:0.158142 jitter:0.010922 clock drift:+9.343ppm tc:6 | 1777 | //15:31:53.473 update from:<IP> offset:+0.000007 delay:0.158142 jitter:0.010922 clock drift:+9.343ppm tc:6 |
1777 | //15:32:58.902 update from:<IP> offset:-0.000728 delay:0.158222 jitter:0.009454 clock drift:+9.298ppm tc:6 | 1778 | //15:32:58.902 update from:<IP> offset:-0.000728 delay:0.158222 jitter:0.009454 clock drift:+9.298ppm tc:6 |
1778 | /* | 1779 | /* |
1779 | * This expression would choose 15 in the above example. | 1780 | * This expression would choose MIN_FREQHOLD + 7 in the above example. |
1780 | */ | 1781 | */ |
1781 | G.FREQHOLD_cnt = 8 + ((unsigned)(abs(tmx.offset)) >> 16); | 1782 | G.FREQHOLD_cnt = MIN_FREQHOLD + ((unsigned)(abs(tmx.offset)) >> 16); |
1782 | } | 1783 | } |
1783 | G.FREQHOLD_cnt--; | 1784 | G.FREQHOLD_cnt--; |
1784 | tmx.status |= STA_FREQHOLD; | 1785 | tmx.status |= STA_FREQHOLD; |