refactor(client): replace unsafe libc calls with nix for Linux ancillary data

Eliminate unsafe code blocks and manual pointer arithmetic in Linux-specific receive paths by utilizing nix for socket options and control message parsing. This improves safety and maintainability while preserving the existing kernel RX timestamp and traffic class functionality.
This commit is contained in:
Nils Andreas Svee committed 2026-08-11 13:38:56 +07:00
1 parent 3c6c0e396f
commit 373bf32d0f
4 files changed
+57 -150

No files matched your search

+4 -2
View File
@@ -13,14 +13,16 @@ categories = ["network-programming"]
[dependencies]
irtt-proto.workspace = true
libc = { version = "0.2.189", optional = true }
socket2 = { version = "0.6.5", features = ["all"] }
thiserror = "2.0.20"
tokio = { version = "1", default-features = false, features = ["rt", "net", "time", "sync"], optional = true}
[target.'cfg(target_os = "linux")'.dependencies]
nix = { version = "0.31", default-features = false, features = ["net", "uio"], optional = true }
[features]
default = []
ancillary = ["dep:libc"]
ancillary = ["dep:nix"]
tokio = ["dep:tokio"]
[package.metadata.docs.rs]