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 recent socket timestamping flags for Linux and Android #4273

Merged

Conversation

fishilico
Copy link
Contributor

Description

Linux (and Android) defines 3 more flags for socket option SO_TIMESTAMPING.

Sources

These flags are defined in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/net_tstamp.h?h=v6.13

Android C library (bionic) picked this flags up: https://android.googlesource.com/platform//bionic/+/9cdc362a2f7463670a766400defcd332a9edfe19/libc/kernel/uapi/linux/net_tstamp.h

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2025

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @tgross35 (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2025

Some changes occurred in the Android module

cc @maurer

@fishilico
Copy link
Contributor Author

I see the CI reports:

 cargo:warning=/checkout/target/x86_64-unknown-linux-gnu/debug/build/libc-test-7132206631aec557/out/main.c:47700:89:
error: 'SOF_TIMESTAMPING_OPT_RX_FILTER' undeclared here (not in a function);
did you mean 'SOF_TIMESTAMPING_OPT_ID_TCP'?
 cargo:warning=47700 |             static const unsigned int __test_const_SOF_TIMESTAMPING_OPT_RX_FILTER_val = SOF_TIMESTAMPING_OPT_RX_FILTER;
 cargo:warning=      |                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 cargo:warning=      |                                                                                         SOF_TIMESTAMPING_OPT_ID_TCP

and I guess that's because the CI uses Ubuntu 24.10, which currently packages linux-headers-6.11.0-18. SOF_TIMESTAMPING_OPT_RX_FILTER was introduced later, in Linux 6.12.

What is the usual approach regarding kernel changes not present in the headers used by the CI yet?

@tgross35
Copy link
Contributor

You can update the test crate's build.rs, there are overrides that can be set for each OS

@fishilico fishilico force-pushed the add-3-SOF_TIMESTAMPING-flags-linux branch 2 times, most recently from ac4106b to de1f5de Compare February 18, 2025 21:37
@fishilico fishilico force-pushed the add-3-SOF_TIMESTAMPING-flags-linux branch from de1f5de to d1d92db Compare February 18, 2025 21:50
@fishilico
Copy link
Contributor Author

Thanks for the help! I am trying to update libc-test/build.rs to make the CI pass.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Feb 22, 2025
@tgross35 tgross35 added this pull request to the merge queue Feb 22, 2025
Merged via the queue into rust-lang:main with commit 5a8eb47 Feb 22, 2025
44 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Feb 22, 2025
@tgross35 tgross35 mentioned this pull request Feb 22, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Feb 22, 2025
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Feb 23, 2025
@fishilico fishilico deleted the add-3-SOF_TIMESTAMPING-flags-linux branch February 23, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android O-linux O-unix S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants