Ai
1 Star 0 Fork 2

BuildOpenSource/busybox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ntpd.diff 679 Bytes
一键复制 编辑 原始数据 按行查看 历史
Denys Vlasenko 提交于 2016-03-04 14:36 +08:00 . ntpd: add experimental patch
This patch scales down small offsets quadratically. Reduces sensitivity to jitter
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 4695c33..ac05815 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -1654,6 +1654,17 @@ update_local_clock(peer_t *p)
*/
if (G.offset_to_jitter_ratio >= TIMECONST_HACK_GATE)
tmx.constant--;
+
+{
+ double d = p->lastpkt_delay;
+ if (d > SLEW_THRESHOLD)
+ d = SLEW_THRESHOLD;
+ d /= 2;
+ if ((abs_offset / d) < 1) {
+ offset *= (abs_offset / d);
+ }
+}
+
tmx.offset = (long)(offset * 1000000); /* usec */
if (SLEW_THRESHOLD < STEP_THRESHOLD) {
if (tmx.offset > (long)(SLEW_THRESHOLD * 1000000)) {
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/build-open-source/busybox.git
git@gitee.com:build-open-source/busybox.git
build-open-source
busybox
busybox
master

搜索帮助