[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH 1/5] ntpd: don't wait for good offset before disabling burst mode
From:       Miroslav Lichvar <mlichvar () redhat ! com>
Date:       2014-09-18 14:19:03
Message-ID: 1411049947-6871-2-git-send-email-mlichvar () redhat ! com
[Download RAW message or body]

The burst mode needs to be stopped when no replies are received.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
---
 networking/ntpd.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/networking/ntpd.c b/networking/ntpd.c
index cfe6956..3c708c1 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -1472,12 +1472,6 @@ update_local_clock(peer_t *p)
 
 	} else { /* abs_offset <= STEP_THRESHOLD */
 
-		if (G.poll_exp < MINPOLL && G.initial_poll_complete) {
-			VERB4 bb_error_msg("small offset:%+f, disabling burst mode", offset);
-			G.polladj_count = 0;
-			G.poll_exp = MINPOLL;
-		}
-
 		/* Compute the clock jitter as the RMS of exponentially
 		 * weighted offset differences. Used by the poll adjust code.
 		 */
@@ -2242,6 +2236,9 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
 				if (p->p_fd == -1) {
 					/* Time to send new req */
 					if (--cnt == 0) {
+						VERB4 bb_error_msg("disabling burst mode");
+						G.polladj_count = 0;
+						G.poll_exp = MINPOLL;
 						G.initial_poll_complete = 1;
 					}
 					send_query_to_peer(p);
-- 
1.9.3

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic