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 RTF_*, RTA_*, RTAX_*, RTM_* definitions on BSDs #3714

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

@rustbot
Copy link
Collaborator

rustbot commented May 19, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented May 19, 2024

Some changes occurred in OpenBSD module

cc @semarie

Some changes occurred in OpenBSD module

cc @semarie

@tesuji tesuji force-pushed the rtf branch 2 times, most recently from 4a0d782 to cffe959 Compare May 19, 2024 19:46
@jbeich
Copy link

jbeich commented May 20, 2024

Do you plan to unify with macOS (same ancestor) by moving RTM_ADD and other constants with same values to src/unix/bsd/mod.rs ?

@tesuji tesuji force-pushed the rtf branch 2 times, most recently from 7e8a9c5 to 9d8b39c Compare May 21, 2024 08:55
@jbeich
Copy link

jbeich commented May 21, 2024

Please, don't remove *_MAX unless applied to macOS as well:

error[E0425]: cannot find value `RTAX_MAX` in crate `libc`
   --> cargo-crates/iroh-net-0.16.2/src/net/interfaces/bsd.rs:875:46
    |
875 |     let mut addrs = Vec::with_capacity(libc::RTAX_MAX as usize);
    |                                              ^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `RTAX_MAX` in crate `libc`
   --> cargo-crates/iroh-net-0.16.2/src/net/interfaces/bsd.rs:879:23
    |
879 |     for i in 0..libc::RTAX_MAX as usize {
    |                       ^^^^^^^^ not found in `libc`
    |
help: you might have meant to write `.` instead of `..`
    |
879 -     for i in 0..libc::RTAX_MAX as usize {
879 +     for i in 0.libc::RTAX_MAX as usize {
    |

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 15, 2024
@tgross35
Copy link
Contributor

tgross35 commented Aug 15, 2024

At first glance this looks okay, but there are a couple things needed. Could you please do the following?

  1. Target main
  2. Squash the commits
  3. Update the libc-test/semver files since this now affects more platforms. A couple lines were touched, but there were a lot of constants added.

@tgross35
Copy link
Contributor

@rustbot author

@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2024

Some changes occurred in solarish module

cc @jclulow, @pfmooney

@tesuji tesuji changed the base branch from libc-0.2 to main September 4, 2024 18:27
@larseggert
Copy link
Contributor

It'd be great to land this, so mozilla/mtu#29 would work on the BSDs.

@tgross35 tgross35 enabled auto-merge October 15, 2024 02:10
@tgross35 tgross35 added this pull request to the merge queue Oct 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 15, 2024
* Unify RTM_ADD and friends under bsd namespace
* Keeps RTAX_MAX as it is used to loop over alternate internal encoding.
@tgross35 tgross35 enabled auto-merge October 15, 2024 03:10
@tgross35 tgross35 added this pull request to the merge queue Oct 15, 2024
Merged via the queue into rust-lang:main with commit a31cb99 Oct 15, 2024
40 of 41 checks passed
semarie added a commit to semarie/rust-libc that referenced this pull request Oct 15, 2024
semarie added a commit to semarie/rust-libc that referenced this pull request Oct 15, 2024
semarie added a commit to semarie/rust-libc that referenced this pull request Oct 15, 2024
@tesuji tesuji deleted the rtf branch October 15, 2024 11:46
@tgross35
Copy link
Contributor

Going to wait on the backport until #3970 is figured out.

github-merge-queue bot pushed a commit that referenced this pull request Oct 16, 2024
unbreak OpenBSD after #3714 by properly define RTF_FMASK
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Oct 16, 2024
* Unify RTM_ADD and friends under bsd namespace
* Keeps RTAX_MAX as it is used to loop over alternate internal encoding.

(backport <rust-lang#3714>)
(cherry picked from commit e1566fd)
@tgross35 tgross35 mentioned this pull request Oct 16, 2024
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Oct 16, 2024
@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 Oct 17, 2024
mxinden added a commit to mxinden/mtu that referenced this pull request Nov 29, 2024
mozilla#29 added the following `libc` import:

``` rust
use libc::{
    freeifaddrs, getifaddrs, getpid, if_data, if_indextoname, ifaddrs, in6_addr, in_addr,
    sockaddr_in, sockaddr_in6, sockaddr_storage, AF_UNSPEC, PF_ROUTE, RTAX_MAX,
};
```

`RTAX_MAX` was added in `libc` `0.2.160`:

https://github.com/rust-lang/libc/releases/tag/0.2.160

More specifically rust-lang/libc#3714.

This commit makes sure the above new requirement is encoded in the `mtu`
`Cargo.toml` `libc` dependency declaration.

See CI failure without discussed in mozilla#51 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Missing RTF_*, RTA_*, RTAX_*, RTM_* definitions on BSDs
6 participants