diff --git a/ntpd/src/daemon/system.rs b/ntpd/src/daemon/system.rs index 8c328497c..21a8b30ce 100644 --- a/ntpd/src/daemon/system.rs +++ b/ntpd/src/daemon/system.rs @@ -13,8 +13,8 @@ use super::{ use std::{collections::HashMap, future::Future, marker::PhantomData, pin::Pin, sync::Arc}; use ntp_proto::{ - KalmanClockController, KeySet, NtpClock, NtpDuration, PeerSnapshot, SourceDefaultsConfig, - SynchronizationConfig, SystemSnapshot, TimeSyncController, + KalmanClockController, KeySet, NtpClock, NtpDuration, NtpLeapIndicator, PeerSnapshot, + SourceDefaultsConfig, SynchronizationConfig, SystemSnapshot, TimeSyncController, }; use ntp_udp::{EnableTimestamps, InterfaceName}; use tokio::{sync::mpsc, task::JoinHandle}; @@ -193,11 +193,16 @@ impl System { keyset: tokio::sync::watch::Receiver>, ) -> (Self, DaemonChannels) { // Setup system snapshot - let system = SystemSnapshot { + let mut system = SystemSnapshot { stratum: synchronization_config.local_stratum, ..Default::default() }; + if synchronization_config.local_stratum == 1 { + // We are a stratum 1 server so mark our selves synchronized. + system.time_snapshot.leap_indicator = NtpLeapIndicator::NoWarning; + } + // Create communication channels let (synchronization_config_sender, synchronization_config_receiver) = tokio::sync::watch::channel(synchronization_config);