aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-07-25 14:58:49 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-07-25 14:58:49 +0200
commit79153cb6bc5a39b00e3c43988a265804ac609837 (patch)
tree194dd1bf4fcf798c9d675c56e939bd437f3a3a3c
parent1ab3899d49bda113671bf787a43d90c683faf2a8 (diff)
downloadbusybox-w32-79153cb6bc5a39b00e3c43988a265804ac609837.tar.gz
busybox-w32-79153cb6bc5a39b00e3c43988a265804ac609837.tar.bz2
busybox-w32-79153cb6bc5a39b00e3c43988a265804ac609837.zip
htpd: increase MIN_FREQHOLD by 3
This means we'll start correcting frequency ~5 minutes after start, not ~3.5 ones. With previos settings I still often see largish ~0.7s initial offsets only about 1/2 corrected before frequency correction kicks in, resulting in ~200ppm "correction" which is then slowly undone. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ntpd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 7b800369e..7462113ce 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -149,7 +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 MIN_FREQHOLD 12 /* adjust offset, but not freq in this many first adjustments */
153#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 */
154 154
155#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) */
@@ -1777,9 +1777,9 @@ update_local_clock(peer_t *p)
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:31:53.473 update from:<IP> offset:+0.000007 delay:0.158142 jitter:0.010922 clock drift:+9.343ppm 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//15:32:58.902 update from:<IP> offset:-0.000728 delay:0.158222 jitter:0.009454 clock drift:+9.298ppm tc:6
1779 /* 1779 /*
1780 * This expression would choose MIN_FREQHOLD + 7 in the above example. 1780 * This expression would choose MIN_FREQHOLD + 8 in the above example.
1781 */ 1781 */
1782 G.FREQHOLD_cnt = MIN_FREQHOLD + ((unsigned)(abs(tmx.offset)) >> 16); 1782 G.FREQHOLD_cnt = 1 + MIN_FREQHOLD + ((unsigned)(abs(tmx.offset)) >> 16);
1783 } 1783 }
1784 G.FREQHOLD_cnt--; 1784 G.FREQHOLD_cnt--;
1785 tmx.status |= STA_FREQHOLD; 1785 tmx.status |= STA_FREQHOLD;