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

Adding RTEXT_FILTER* constants from linux/rtnetlink.h #3035

Merged
merged 2 commits into from
Apr 2, 2023

Conversation

jreppnow
Copy link
Contributor

@jreppnow jreppnow commented Dec 12, 2022

Adding some constants needed for some specific netlink-route interactions (fetching information on a network interface). They are defined at linux/rtnetlink.h.

@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2022

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.

Please see the contribution instructions for more information.

@jreppnow
Copy link
Contributor Author

The RTEXT_FILTER_MST constant is available locally for me (Linux 6.0.12), but was not available on your CI and presumably is not available on the majority of active Linux systems yet (added to the kernel header ~9 months ago), so I removed it for this PR. I personally don't need it for my use case.

@JohnTitor
Copy link
Member

Thanks! @bors r+

@bors
Copy link
Contributor

bors commented Dec 14, 2022

📌 Commit 691ac46 has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 14, 2022

⌛ Testing commit 691ac46 with merge c29d70a...

bors added a commit that referenced this pull request Dec 14, 2022
Adding RTEXT_FILTER* constants from linux/rtnetlink.h

Hi *,

this PR adds some constants needed for some specific netlink-route interactions (fetching information on a network interface). They are defined here: https://github.com/torvalds/linux/blob/master/include/uapi/linux/rtnetlink.h (lines 813 and onwards atm).

The required tests passed for me locally. Please let me know if there is anything else you need!

BR,
Janosch.
@bors
Copy link
Contributor

bors commented Dec 14, 2022

💔 Test failed - checks-actions

@jreppnow
Copy link
Contributor Author

The CI seems to fail since MUSL is still using modified headers based on Linux 4.19.* (https://github.com/sabotage-linux/kernel-headers), which are also missing RTEXT_FILTER_MRP (added 3 years ago), RTEXT_FILTER_CFM_CONFIG and RTEXT_FILTER_CFM_STATUS (added 2 years ago). Linux 4.19 is a longterm release with support until Dec, 2024.

I only need RTEXT_FILTER_VF and RTEXT_FILTER_SKIP_STATS at the moment, so I would be fine with only adding the first four constants (all added more than 7 years ago), but I guess it would be nice if there was a way to have them included for systems where they are available?

@JohnTitor What is your preference? Remove the "newer" constants and only add what's available for all LTR kernels? Or is there possibly a way to conditionally include this only for specific Linux versions?

@JohnTitor
Copy link
Member

Our musl image is too old because we haven't made a decision around the time64 breaking change.
Anyway, adding newer consts doesn't break the build for older musl users but the libc crate users have to care about it when using, so it should be totally fine to add them. Let's ignore them on the tests, you could tweak the below to do that:

cfg.skip_const(move |name| {

@jreppnow
Copy link
Contributor Author

@JohnTitor Sorry for taking so long. I added the exception as requested, here is hoping it goes through this time.

@JohnTitor
Copy link
Member

Sorry for the delay!
@bors r+

@bors
Copy link
Contributor

bors commented Feb 22, 2023

📌 Commit 4b6f95e has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 22, 2023

⌛ Testing commit 4b6f95e with merge 11718c8...

bors added a commit that referenced this pull request Feb 22, 2023
Adding RTEXT_FILTER* constants from linux/rtnetlink.h

Adding some constants needed for some specific netlink-route interactions (fetching information on a network interface). They are defined at ```linux/rtnetlink.h```.
@bors
Copy link
Contributor

bors commented Feb 22, 2023

💔 Test failed - checks-actions

@JohnTitor
Copy link
Member

  cargo:warning=/checkout/target/sparc64-unknown-linux-gnu/debug/build/libc-test-64aa1e29acfc6337/out/main.c:33542:66: error: 'RTEXT_FILTER_MRP' undeclared here (not in a function); did you mean 'RTEXT_FILTER_VF'?
  cargo:warning=33542 |             static const int __test_const_RTEXT_FILTER_MRP_val = RTEXT_FILTER_MRP;
  cargo:warning=      |                                                                  ^~~~~~~~~~~~~~~~
  cargo:warning=      |                                                                  RTEXT_FILTER_VF
  cargo:warning=/checkout/target/sparc64-unknown-linux-gnu/debug/build/libc-test-64aa1e29acfc6337/out/main.c:33548:73: error: 'RTEXT_FILTER_CFM_CONFIG' undeclared here (not in a function)
  cargo:warning=33548 |             static const int __test_const_RTEXT_FILTER_CFM_CONFIG_val = RTEXT_FILTER_CFM_CONFIG;
  cargo:warning=      |                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=/checkout/target/sparc64-unknown-linux-gnu/debug/build/libc-test-64aa1e29acfc6337/out/main.c:33554:73: error: 'RTEXT_FILTER_CFM_STATUS' undeclared here (not in a function); did you mean 'RTEXT_FILTER_SKIP_STATS'?
  cargo:warning=33554 |             static const int __test_const_RTEXT_FILTER_CFM_STATUS_val = RTEXT_FILTER_CFM_STATUS;
  cargo:warning=      |                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                                         RTEXT_FILTER_SKIP_STATS
  cargo:warning=cc1: error: unrecognized command line option '-Wno-unknown-warning-option' [-Werror]

if musl || sparc64 should work here.

@jreppnow
Copy link
Contributor Author

@JohnTitor I left in both exceptions/ifs now, hope that's fine.

I wonder if I can also re-try? @bors try

@bors
Copy link
Contributor

bors commented Feb 26, 2023

@jreppnow: 🔑 Insufficient privileges: not in try users

@JohnTitor
Copy link
Member

LGTM, thank you.
@bors r+

@bors
Copy link
Contributor

bors commented Apr 1, 2023

📌 Commit 63ba3a0 has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 1, 2023

⌛ Testing commit 63ba3a0 with merge 3bb4f52...

bors added a commit that referenced this pull request Apr 1, 2023
Adding RTEXT_FILTER* constants from linux/rtnetlink.h

Adding some constants needed for some specific netlink-route interactions (fetching information on a network interface). They are defined at ```linux/rtnetlink.h```.
@bors
Copy link
Contributor

bors commented Apr 1, 2023

💔 Test failed - checks-cirrus-freebsd-14

@JohnTitor
Copy link
Member

@bors retry

@bors
Copy link
Contributor

bors commented Apr 2, 2023

⌛ Testing commit 63ba3a0 with merge 26c13fd...

@bors
Copy link
Contributor

bors commented Apr 2, 2023

☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14
Approved by: JohnTitor
Pushing 26c13fd to master...

@bors bors merged commit 26c13fd into rust-lang:master Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants