summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2010-06-24 20:23:40 +0200
committerDenys Vlasenko2010-06-24 20:23:40 +0200
commiteff6d593437afa91f7fb7c418e13dfb2ddb6886b (patch)
treeb7afb43e6b9f80064ee2e852ebc7d7932829a405
parenta54985b27919313e97a2b49fe4b5f87824886d92 (diff)
downloadbusybox-eff6d593437afa91f7fb7c418e13dfb2ddb6886b.zip
busybox-eff6d593437afa91f7fb7c418e13dfb2ddb6886b.tar.gz
ntpd: step correction to variables had wrong sign, fixing
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ntpd.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 6d9183a..14c3a5f 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -603,9 +603,9 @@ reset_peer_stats(peer_t *p, double offset)
for (i = 0; i < NUM_DATAPOINTS; i++) {
if (small_ofs) {
- p->filter_datapoint[i].d_recv_time -= offset;
+ p->filter_datapoint[i].d_recv_time += offset;
if (p->filter_datapoint[i].d_offset != 0) {
- p->filter_datapoint[i].d_offset -= offset;
+ p->filter_datapoint[i].d_offset += offset;
}
} else {
p->filter_datapoint[i].d_recv_time = G.cur_time;
@@ -614,13 +614,12 @@ reset_peer_stats(peer_t *p, double offset)
}
}
if (small_ofs) {
- p->lastpkt_recv_time -= offset;
+ p->lastpkt_recv_time += offset;
} else {
p->reachable_bits = 0;
p->lastpkt_recv_time = G.cur_time;
}
filter_datapoints(p); /* recalc p->filter_xxx */
- p->next_action_time -= offset;
VERB5 bb_error_msg("%s->lastpkt_recv_time=%f", p->p_dotted, p->lastpkt_recv_time);
}
@@ -815,11 +814,14 @@ step_time(double offset)
for (item = G.ntp_peers; item != NULL; item = item->link) {
peer_t *pp = (peer_t *) item->data;
reset_peer_stats(pp, offset);
+ //bb_error_msg("offset:%f pp->next_action_time:%f -> %f",
+ // offset, pp->next_action_time, pp->next_action_time + offset);
+ pp->next_action_time += offset;
}
/* Globals: */
- G.cur_time -= offset;
- G.last_update_recv_time -= offset;
- G.last_script_run -= offset;
+ G.cur_time += offset;
+ G.last_update_recv_time += offset;
+ G.last_script_run += offset;
}