aboutsummaryrefslogtreecommitdiff
path: root/networking/ntpd.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-06-24 20:23:40 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-06-24 20:23:40 +0200
commiteff6d593437afa91f7fb7c418e13dfb2ddb6886b (patch)
treeb7afb43e6b9f80064ee2e852ebc7d7932829a405 /networking/ntpd.c
parenta54985b27919313e97a2b49fe4b5f87824886d92 (diff)
downloadbusybox-w32-eff6d593437afa91f7fb7c418e13dfb2ddb6886b.tar.gz
busybox-w32-eff6d593437afa91f7fb7c418e13dfb2ddb6886b.tar.bz2
busybox-w32-eff6d593437afa91f7fb7c418e13dfb2ddb6886b.zip
ntpd: step correction to variables had wrong sign, fixing
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ntpd.c')
-rw-r--r--networking/ntpd.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 6d9183a4b..14c3a5fbb 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -603,9 +603,9 @@ reset_peer_stats(peer_t *p, double offset)
603 603
604 for (i = 0; i < NUM_DATAPOINTS; i++) { 604 for (i = 0; i < NUM_DATAPOINTS; i++) {
605 if (small_ofs) { 605 if (small_ofs) {
606 p->filter_datapoint[i].d_recv_time -= offset; 606 p->filter_datapoint[i].d_recv_time += offset;
607 if (p->filter_datapoint[i].d_offset != 0) { 607 if (p->filter_datapoint[i].d_offset != 0) {
608 p->filter_datapoint[i].d_offset -= offset; 608 p->filter_datapoint[i].d_offset += offset;
609 } 609 }
610 } else { 610 } else {
611 p->filter_datapoint[i].d_recv_time = G.cur_time; 611 p->filter_datapoint[i].d_recv_time = G.cur_time;
@@ -614,13 +614,12 @@ reset_peer_stats(peer_t *p, double offset)
614 } 614 }
615 } 615 }
616 if (small_ofs) { 616 if (small_ofs) {
617 p->lastpkt_recv_time -= offset; 617 p->lastpkt_recv_time += offset;
618 } else { 618 } else {
619 p->reachable_bits = 0; 619 p->reachable_bits = 0;
620 p->lastpkt_recv_time = G.cur_time; 620 p->lastpkt_recv_time = G.cur_time;
621 } 621 }
622 filter_datapoints(p); /* recalc p->filter_xxx */ 622 filter_datapoints(p); /* recalc p->filter_xxx */
623 p->next_action_time -= offset;
624 VERB5 bb_error_msg("%s->lastpkt_recv_time=%f", p->p_dotted, p->lastpkt_recv_time); 623 VERB5 bb_error_msg("%s->lastpkt_recv_time=%f", p->p_dotted, p->lastpkt_recv_time);
625} 624}
626 625
@@ -815,11 +814,14 @@ step_time(double offset)
815 for (item = G.ntp_peers; item != NULL; item = item->link) { 814 for (item = G.ntp_peers; item != NULL; item = item->link) {
816 peer_t *pp = (peer_t *) item->data; 815 peer_t *pp = (peer_t *) item->data;
817 reset_peer_stats(pp, offset); 816 reset_peer_stats(pp, offset);
817 //bb_error_msg("offset:%f pp->next_action_time:%f -> %f",
818 // offset, pp->next_action_time, pp->next_action_time + offset);
819 pp->next_action_time += offset;
818 } 820 }
819 /* Globals: */ 821 /* Globals: */
820 G.cur_time -= offset; 822 G.cur_time += offset;
821 G.last_update_recv_time -= offset; 823 G.last_update_recv_time += offset;
822 G.last_script_run -= offset; 824 G.last_script_run += offset;
823} 825}
824 826
825 827