From: Miroslav Lichvar Date: Wed, 3 Aug 2016 10:13:22 +0000 (+0200) Subject: ntp: reset tentative flag only when sample was accumulated X-Git-Tag: 3.0-pre1~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0838280a985ab5fc1a781e1fea2e5f15a688545;p=thirdparty%2Fchrony.git 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. --- diff --git a/ntp_core.c b/ntp_core.c index ae42b5b5..7ea4a6c7 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 dbd47486..32407b4f 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) {