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

Open
wants to merge 4 commits into
base: libc-0.2
Choose a base branch
from

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

pub const RTF_WASCLONED: ::c_int = 0x20000;
pub const RTF_MPLSOPS: ::c_int = 0x1000000;

pub const RTM_VERSION: ::c_int = 7;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

shall I remove this place holder?

Copy link

Choose a reason for hiding this comment

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

Would be inconsistent with macOS:

pub const RTM_VERSION: ::c_int = 5;

Besides, RTM_VERSION is used by iroh-net.

@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 ?

@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 {
    |

This reverts commit 0f93088.

`RTAX_MAX` is used to loop over alternate internal encoding.
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