From b0838280a985ab5fc1a781e1fea2e5f15a688545 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 3 Aug 2016 12:13:22 +0200 Subject: [PATCH] ntp: reset tentative flag only when sample was accumulated When selecting sources from a pool, ignore responses which didn't produce a new sample. Sources with acceptable delay (as configured by the maxdelay* options) should be prefered. --- ntp_core.c | 2 +- ntp_sources.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ntp_core.c b/ntp_core.c index ae42b5b..7ea4a6c 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1519,7 +1519,7 @@ receive_packet(NTP_Packet *message, struct timeval *now, double now_err, NCR_Ins pkt_root_delay, pkt_root_dispersion); } - return valid_packet; + return good_packet; } /* ================================================== */ diff --git a/ntp_sources.c b/ntp_sources.c index dbd4748..32407b4 100644 --- a/ntp_sources.c +++ b/ntp_sources.c @@ -792,7 +792,7 @@ NSR_ProcessReceive(NTP_Packet *message, struct timeval *now, double now_err, NTP return; if (record->tentative) { - /* This was the first valid reply from the source */ + /* This was the first good reply from the source */ record->tentative = 0; if (record->pool != INVALID_POOL) {