-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
In statime-linux, system_offset expects UnixClock::system_offset (from clock-steering) to be REALTIME:
// The clock crate's system offset gives the T1 and T3 timestamps on the
// CLOCK_REALTIME timescale which is UTC, not TAI, so we need to correct
// here. let tai_offset = UnixClock::CLOCK_REALTIME.get_tai().unwrap();
t1.seconds += tai_offset as libc::time_t;
t3.seconds += tai_offset as libc::time_t;However, here, clock-steering uses TAI, both in fallback userspace timestamp sandwitching:
let t1 = Self::CLOCK_TAI.now();
let tp = self.now();
let t2 = Self::CLOCK_TAI.now();and it already converts PTP_SYS_OFFSET result which is REALTIME to TAI:
let tai_offset = Self::CLOCK_TAI.get_tai()?;
Ok((
Timestamp {
seconds: (offset.ts[0].sec + tai_offset as i64) as _,
nanos: offset.ts[0].nsec as _,
},
Timestamp {
seconds: offset.ts[1].sec as _,
nanos: offset.ts[1].nsec as _,
},
Timestamp {
seconds: (offset.ts[2].sec + tai_offset as i64) as _,
nanos: offset.ts[2].nsec as _,
},
))So is it really wrong or am I missing something?
Metadata
Metadata
Assignees
Labels
No labels