diff --git a/ntp_core.c b/ntp_core.c index 55f1e96..53858f6 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -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; diff --git a/sources.c b/sources.c index b9e095d..e24463d 100644 --- a/sources.c +++ b/sources.c @@ -1167,6 +1167,14 @@ SRC_IsSyncPeer(SRC_Instance inst) /* ================================================== */ +int +SRC_IsReachable(SRC_Instance inst) +{ + return inst->reachability != 0; +} + +/* ================================================== */ + int SRC_ReadNumberOfSources(void) { diff --git a/sources.h b/sources.h index 64c450d..c28102c 100644 --- a/sources.h +++ b/sources.h @@ -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);