aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/ntpd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 27e2e9f53..b04391eb5 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -805,7 +805,7 @@ send_query_to_peer(peer_t *p)
805 p->p_xmt_msg.m_xmttime.fractionl = random(); 805 p->p_xmt_msg.m_xmttime.fractionl = random();
806 p->p_xmttime = gettime1900d(); 806 p->p_xmttime = gettime1900d();
807 807
808 /* Was doing it only if sendto worked, but 808 /* Were doing it only if sendto worked, but
809 * loss of sync detection needs reachable_bits updated 809 * loss of sync detection needs reachable_bits updated
810 * even if sending fails *locally*: 810 * even if sending fails *locally*:
811 * "network is unreachable" because cable was pulled? 811 * "network is unreachable" because cable was pulled?
@@ -818,6 +818,11 @@ send_query_to_peer(peer_t *p)
818 ) { 818 ) {
819 close(p->p_fd); 819 close(p->p_fd);
820 p->p_fd = -1; 820 p->p_fd = -1;
821 /*
822 * We know that we sent nothing.
823 * We can retry *soon* without fearing
824 * that we are flooding the peer.
825 */
821 set_next(p, RETRY_INTERVAL); 826 set_next(p, RETRY_INTERVAL);
822 return; 827 return;
823 } 828 }
@@ -827,7 +832,7 @@ send_query_to_peer(peer_t *p)
827 832
828 833
829/* Note that there is no provision to prevent several run_scripts 834/* Note that there is no provision to prevent several run_scripts
830 * to be done in quick succession. In fact, it happens rather often 835 * to be started in quick succession. In fact, it happens rather often
831 * if initial syncronization results in a step. 836 * if initial syncronization results in a step.
832 * You will see "step" and then "stratum" script runs, sometimes 837 * You will see "step" and then "stratum" script runs, sometimes
833 * as close as only 0.002 seconds apart. 838 * as close as only 0.002 seconds apart.
@@ -2228,7 +2233,7 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
2228 G.polladj_count = 0; 2233 G.polladj_count = 0;
2229 G.poll_exp = MINPOLL; 2234 G.poll_exp = MINPOLL;
2230 G.stratum = MAXSTRAT; 2235 G.stratum = MAXSTRAT;
2231 run_script("unsync", G.last_update_offset); 2236 run_script("unsync", 0.0);
2232 have_reachable_peer: ; 2237 have_reachable_peer: ;
2233 } 2238 }
2234 } /* while (!bb_got_signal) */ 2239 } /* while (!bb_got_signal) */