ntp: don't stop online burst when sending fails

Don't stop online burst for unreachable sources until sending succeeds.
This is mainly useful with iburst when chronyd is started before the
network is configured.
This commit is contained in:
Miroslav Lichvar 2014-08-20 16:41:18 +02:00
parent d446950c6a
commit 4e66b5ce8a
3 changed files with 13 additions and 0 deletions

View file

@ -891,6 +891,10 @@ transmit_timeout(void *arg)
switch (inst->opmode) {
case MD_BURST_WAS_ONLINE:
/* When not reachable, don't stop online burst until sending succeeds */
if (!sent && !SRC_IsReachable(inst->source))
break;
/* Fall through */
case MD_BURST_WAS_OFFLINE:
--inst->burst_total_samples_to_go;
break;

View file

@ -1167,6 +1167,14 @@ SRC_IsSyncPeer(SRC_Instance inst)
/* ================================================== */
int
SRC_IsReachable(SRC_Instance inst)
{
return inst->reachability != 0;
}
/* ================================================== */
int
SRC_ReadNumberOfSources(void)
{

View file

@ -171,6 +171,7 @@ extern void SRC_DumpSources(void);
extern void SRC_ReloadSources(void);
extern int SRC_IsSyncPeer(SRC_Instance inst);
extern int SRC_IsReachable(SRC_Instance inst);
extern int SRC_ReadNumberOfSources(void);
extern int SRC_ActiveSources(void);
extern int SRC_ReportSource(int index, RPT_SourceReport *report, struct timeval *now);