aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Lichvar <mlichvar@redhat.com>2014-09-18 16:19:03 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2014-09-24 15:21:18 +0200
commitfb143f783da8a3b13ae7a35f6750c2d0c86081e6 (patch)
tree999fa5848b235028978e0a4f3e610e8191cbb664
parent0f78d616cb394925d8b9511d370643ddd445adc3 (diff)
downloadbusybox-w32-fb143f783da8a3b13ae7a35f6750c2d0c86081e6.tar.gz
busybox-w32-fb143f783da8a3b13ae7a35f6750c2d0c86081e6.tar.bz2
busybox-w32-fb143f783da8a3b13ae7a35f6750c2d0c86081e6.zip
ntpd: don't wait for good offset before disabling burst mode
The burst mode needs to be stopped even when no replies are received. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ntpd.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index cfe695631..3c708c1c5 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -1472,12 +1472,6 @@ update_local_clock(peer_t *p)
1472 1472
1473 } else { /* abs_offset <= STEP_THRESHOLD */ 1473 } else { /* abs_offset <= STEP_THRESHOLD */
1474 1474
1475 if (G.poll_exp < MINPOLL && G.initial_poll_complete) {
1476 VERB4 bb_error_msg("small offset:%+f, disabling burst mode", offset);
1477 G.polladj_count = 0;
1478 G.poll_exp = MINPOLL;
1479 }
1480
1481 /* Compute the clock jitter as the RMS of exponentially 1475 /* Compute the clock jitter as the RMS of exponentially
1482 * weighted offset differences. Used by the poll adjust code. 1476 * weighted offset differences. Used by the poll adjust code.
1483 */ 1477 */
@@ -2242,6 +2236,9 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
2242 if (p->p_fd == -1) { 2236 if (p->p_fd == -1) {
2243 /* Time to send new req */ 2237 /* Time to send new req */
2244 if (--cnt == 0) { 2238 if (--cnt == 0) {
2239 VERB4 bb_error_msg("disabling burst mode");
2240 G.polladj_count = 0;
2241 G.poll_exp = MINPOLL;
2245 G.initial_poll_complete = 1; 2242 G.initial_poll_complete = 1;
2246 } 2243 }
2247 send_query_to_peer(p); 2244 send_query_to_peer(p);