From: Miroslav Lichvar Date: Wed, 14 Apr 2021 10:36:28 +0000 (+0200) Subject: ntp: clamp remote stratum X-Git-Tag: 4.1-pre1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=635a9d3f5a7c7ed35bf11c57105252ce8cbccfa6;p=thirdparty%2Fchrony.git ntp: clamp remote stratum Don't set the remote stratum (used for polling adjustments) to values larger than 16. --- diff --git a/ntp_core.c b/ntp_core.c index 37423329..51c11fd1 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1759,7 +1759,7 @@ process_response(NCR_Instance inst, NTP_Local_Address *local_addr, if (valid_packet) { inst->remote_poll = message->poll; inst->remote_stratum = message->stratum != NTP_INVALID_STRATUM ? - message->stratum : NTP_MAX_STRATUM; + MIN(message->stratum, NTP_MAX_STRATUM) : NTP_MAX_STRATUM; inst->prev_local_poll = inst->local_poll; inst->prev_tx_count = inst->tx_count;