Skip to content

Commit c8b8408

Browse files
committed
Fix csptp timer not properly resetting.
1 parent 075ee3b commit c8b8408

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ntpd/src/daemon/csptp_source.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use timestamped_socket::{
1212
interface::InterfaceName,
1313
socket::{Connected, RecvResult, Socket, open_ip},
1414
};
15-
use tracing::{Instrument, Span, error, instrument, warn};
15+
use tracing::{error, info, instrument, warn, Instrument, Span};
1616

1717
use crate::daemon::{
1818
config::TimestampMode,
@@ -154,6 +154,10 @@ impl<C: 'static + NtpClock + Send, Controller: SourceController<MeasurementDelay
154154

155155
match selected {
156156
SelectResult::Timer => {
157+
poll_wait
158+
.as_mut()
159+
.reset(tokio::time::Instant::now() + std::time::Duration::from_secs(1));
160+
157161
if matches!(self.setup_socket().await, SocketResult::Abort) {
158162
self.channels
159163
.msg_for_system_sender
@@ -301,10 +305,6 @@ impl<C: 'static + NtpClock + Send, Controller: SourceController<MeasurementDelay
301305
self.index,
302306
),
303307
);
304-
305-
poll_wait
306-
.as_mut()
307-
.reset(tokio::time::Instant::now() + std::time::Duration::from_secs(1));
308308
}
309309
SelectResult::Recv(Err(_)) => { /* ignore for now */ }
310310
SelectResult::SystemUpdate(Ok(update)) => {

0 commit comments

Comments
 (0)