Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SO_TS_CLOCK sockopt for packet timestamping on FreeBSD. #2058

Closed
recatek opened this issue Jun 19, 2023 · 1 comment · Fixed by #2093
Closed

Add support for SO_TS_CLOCK sockopt for packet timestamping on FreeBSD. #2058

recatek opened this issue Jun 19, 2023 · 1 comment · Fixed by #2093

Comments

@recatek
Copy link
Contributor

recatek commented Jun 19, 2023

As of FreeBSD 11.3, callers can control which clock is used for reporting packet receipt timestamps (in part for choosing between CLOCK_MONOTONIC and CLOCK_REALTIME). See the SO_TS_CLOCK section in man getsockopt(2). As of 0.2.146 Rust's libc added the relevant optvals for doing this (see rust-lang/libc@694e371).

I've been working on a handwritten proof of concept implementation in Rust for CLOCK_MONOTONIC here, and would be up for trying to add it back into nix if there's interest. Note that this is exclusive to FreeBSD as far as I know, no other bsd-likes support this to my knowledge.

@asomers
Copy link
Member

asomers commented Jun 29, 2023

Yeah, that sounds reasonable. It's pretty easy to add a new sockopt to Nix.

github-merge-queue bot pushed a commit that referenced this issue Aug 27, 2023
* introduces FreeBSD's SO_TS_CLOCK into net::sys::socket::sockopt.

close GH-2058.

* CHANGELOG entry

* changes from feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants