mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 18:35:06 -05:00
ntp: fix time smoothing in interleaved mode
When the server's transmit timestamp was updated with a kernel/HW timestamp, it didn't include the time smoothing offset. If the offset was larger than one second, the update failed and clients using the interleaved mode received less accurate timestamps. If the update succeeded, the clients received timestamps that were not adjusted for the time smoothing offset, which added an error of up to 0.5s/1s to their measured offset/delay. Fix the update to include the smoothing offset in the new timestamp.
This commit is contained in:
@@ -2036,6 +2036,9 @@ NCR_ProcessTxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a
|
||||
if (log_index < 0)
|
||||
return;
|
||||
|
||||
if (SMT_IsEnabled() && NTP_LVM_TO_MODE(message->lvm) == MODE_SERVER)
|
||||
UTI_AddDoubleToTimespec(&tx_ts->ts, SMT_GetOffset(&tx_ts->ts), &tx_ts->ts);
|
||||
|
||||
CLG_GetNtpTimestamps(log_index, &local_ntp_rx, &local_ntp_tx);
|
||||
|
||||
UTI_Ntp64ToTimespec(local_ntp_tx, &local_tx.ts);
|
||||
|
||||
Reference in New Issue
Block a user