summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-05-23 14:06:59 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2013-05-23 14:06:59 (GMT)
commit5a7e3376b7011d3f8f2591d9dead4fc580619096 (patch)
tree77e8e4aa3a7318f2efe3081ec89c1fe9eb4fef14
parent07c5987498bcd3ba276cc9877921467893ada6f0 (diff)
downloadbusybox-5a7e3376b7011d3f8f2591d9dead4fc580619096.tar.gz
busybox-5a7e3376b7011d3f8f2591d9dead4fc580619096.tar.bz2
ntpd: set offset to 0.0 in "usync" event
function old new delta ntpd_main 1030 1026 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ntpd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 27e2e9f..b04391e 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -805,7 +805,7 @@ send_query_to_peer(peer_t *p)
p->p_xmt_msg.m_xmttime.fractionl = random();
p->p_xmttime = gettime1900d();
- /* Was doing it only if sendto worked, but
+ /* Were doing it only if sendto worked, but
* loss of sync detection needs reachable_bits updated
* even if sending fails *locally*:
* "network is unreachable" because cable was pulled?
@@ -818,6 +818,11 @@ send_query_to_peer(peer_t *p)
) {
close(p->p_fd);
p->p_fd = -1;
+ /*
+ * We know that we sent nothing.
+ * We can retry *soon* without fearing
+ * that we are flooding the peer.
+ */
set_next(p, RETRY_INTERVAL);
return;
}
@@ -827,7 +832,7 @@ send_query_to_peer(peer_t *p)
/* Note that there is no provision to prevent several run_scripts
- * to be done in quick succession. In fact, it happens rather often
+ * to be started in quick succession. In fact, it happens rather often
* if initial syncronization results in a step.
* You will see "step" and then "stratum" script runs, sometimes
* as close as only 0.002 seconds apart.
@@ -2228,7 +2233,7 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
G.polladj_count = 0;
G.poll_exp = MINPOLL;
G.stratum = MAXSTRAT;
- run_script("unsync", G.last_update_offset);
+ run_script("unsync", 0.0);
have_reachable_peer: ;
}
} /* while (!bb_got_signal) */