From 68aeab426e94ac54e281b77d9edeafb07864962d Mon Sep 17 00:00:00 2001 From: David Venhoek Date: Fri, 20 Sep 2024 16:02:49 +0200 Subject: [PATCH] Release 0.2.2 --- CHANGELOG.md | 14 ++++++++++++++ Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- docs/man/statime.8.md | 2 +- docs/man/statime.toml.5.md | 2 +- docs/precompiled/man/statime.8 | 2 +- docs/precompiled/man/statime.toml.5 | 11 ++++++++--- statime-linux/src/clock/mod.rs | 5 +++-- 8 files changed, 32 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aae57224..606c32774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.2.2] - 2024-20-09 + +### Added +- Added support for the path trace option +- Added support for disabling synchronization of the system clock, touching only the ptp hardware clocks. + +### Changed +- Updated dependencies +- Be less chatty about unexpected PTPv1 messages + +### Fixed +- Correctly ignore rogue masters in the PTP network + ## [0.2.1] - 2024-06-07 ### Added @@ -32,6 +45,7 @@ ### Fixed - Fixed race condition during startup +[0.2.2]: https://github.com/pendulum-project/statime/compare/v0.2.2...v0.2.1 [0.2.1]: https://github.com/pendulum-project/statime/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/pendulum-project/statime/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/pendulum-project/statime/releases/tag/v0.1.0 diff --git a/Cargo.lock b/Cargo.lock index 40c757a1d..3083ba9c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "statime" -version = "0.2.1" +version = "0.2.2" dependencies = [ "arrayvec", "az", @@ -514,7 +514,7 @@ dependencies = [ [[package]] name = "statime-linux" -version = "0.2.1" +version = "0.2.2" dependencies = [ "arrayvec", "clap", diff --git a/Cargo.toml b/Cargo.toml index f781d342f..f8696ed9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ exclude = [ resolver = "2" [workspace.package] -version = "0.2.1" +version = "0.2.2" edition = "2021" license = "Apache-2.0 OR MIT" repository = "https://github.com/pendulum-project/statime" @@ -53,7 +53,7 @@ timestamped-socket = "0.2.4" # our own crates used as dependencies, same version as the workspace version # NOTE: keep this part at the bottom of the file, do not change this line -statime = { version = "0.2.1", path = "./statime" } +statime = { version = "0.2.2", path = "./statime" } [profile.release] debug = 2 diff --git a/docs/man/statime.8.md b/docs/man/statime.8.md index 90a85888b..9b623eb5c 100644 --- a/docs/man/statime.8.md +++ b/docs/man/statime.8.md @@ -1,5 +1,5 @@ # NAME diff --git a/docs/man/statime.toml.5.md b/docs/man/statime.toml.5.md index eca2a118d..29572f8c7 100644 --- a/docs/man/statime.toml.5.md +++ b/docs/man/statime.toml.5.md @@ -1,5 +1,5 @@ # NAME diff --git a/docs/precompiled/man/statime.8 b/docs/precompiled/man/statime.8 index 4807a6212..c42fb78da 100644 --- a/docs/precompiled/man/statime.8 +++ b/docs/precompiled/man/statime.8 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.4 .\" -.TH "STATIME" "8" "" "statime 0.2.1" "statime" +.TH "STATIME" "8" "" "statime 0.2.2" "statime" .SH NAME \f[CR]statime\f[R] \- The Statime PTP daemon for linux .SH SYNOPSIS diff --git a/docs/precompiled/man/statime.toml.5 b/docs/precompiled/man/statime.toml.5 index 8ecc021c7..0b26006a9 100644 --- a/docs/precompiled/man/statime.toml.5 +++ b/docs/precompiled/man/statime.toml.5 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.4 .\" -.TH "STATIME.TOML" "5" "" "statime 0.2.1" "statime" +.TH "STATIME.TOML" "5" "" "statime 0.2.2" "statime" .SH NAME \f[CR]statime.toml\f[R] \- configuration file for the statime ptp\-daemon @@ -36,12 +36,17 @@ Together with the \f[CR]domain\f[R] it identifies a domain. \f[CR]priority1\f[R] = \f[I]priority\f[R] (\f[B]128\f[R]) A tie breaker for the best master clock algorithm in the range \f[CR]0..256\f[R]. -\f[CR]0\f[R] being highest priority an \f[CR]255\f[R] the lowest. +\f[CR]0\f[R] being the highest priority and \f[CR]255\f[R] the lowest. .TP \f[CR]priority2\f[R] = \f[I]priority\f[R] (\f[B]128\f[R]) A tie breaker for the best master clock algorithm in the range \f[CR]0..256\f[R]. -\f[CR]0\f[R] being highest priority an \f[CR]255\f[R] the lowest. +\f[CR]0\f[R] being the highest priority and \f[CR]255\f[R] the lowest. +.TP +\f[CR]path\-trace\f[R] = \f[I]bool\f[R] +The instance uses the path trace option. +This allows detecting clock loops when enabled on all instances in the +network. .TP \f[CR]virtual\-system\-clock\f[R] = \f[I]bool\f[R] (\f[B]false\f[R]) Use a virtual overlay clock instead of adjusting the system clock. diff --git a/statime-linux/src/clock/mod.rs b/statime-linux/src/clock/mod.rs index 958a6ca4c..c86885985 100644 --- a/statime-linux/src/clock/mod.rs +++ b/statime-linux/src/clock/mod.rs @@ -36,7 +36,8 @@ impl LinuxClock { use clock_steering::Clock; let ts = self.clock.now()?; - if ts.seconds < 0 || ts.seconds > (u64::MAX / 1000000000) as i64 { + #[allow(clippy::unnecessary_cast)] + if ts.seconds < 0 || ts.seconds as i64 > (u64::MAX / 1000000000) as i64 { self.clock.step_clock(TimeOffset { seconds: -ts.seconds + 1, nanos: 0, @@ -181,7 +182,7 @@ impl PortTimestampToTime for LinuxClock { fn port_timestamp_to_time(&self, mut ts: timestamped_socket::socket::Timestamp) -> Time { // get_tai gives zero if this is a hardware clock, and the needed // correction when this port uses software timestamping - ts.seconds += self.get_tai_offset().expect("Unable to get tai offset") as libc::time_t; + ts.seconds += self.get_tai_offset().expect("Unable to get tai offset") as i64; Time::from_fixed_nanos(ts.seconds as i128 * 1_000_000_000i128 + ts.nanos as i128) } }