From 635a9d3f5a7c7ed35bf11c57105252ce8cbccfa6 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 14 Apr 2021 12:36:28 +0200 Subject: [PATCH] ntp: clamp remote stratum Don't set the remote stratum (used for polling adjustments) to values larger than 16. --- ntp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntp_core.c b/ntp_core.c index 3742332..51c11fd 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;