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

[libc-0.2] Freebsd Netlink support backported #3555

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

Conversation

ydirson
Copy link

@ydirson ydirson commented Jan 22, 2024

This is a proposal to bring #3201 and #3367 to libc-0.2 branch, by hiding this change behind a feature flag as suggested by @asomers in #3367 (comment).

This makes it possible to build on FreeBSD 13 eg. sysinfo v0.30.5 from @GuillaumeGomez it the feature flag is not specified, and to build rtnetlink from PR rust-netlink/rtnetlink#49 if it is specified.

@rustbot
Copy link
Collaborator

rustbot commented Jan 22, 2024

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. 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

@ydirson ydirson force-pushed the freebsd-netlink-0.2 branch 4 times, most recently from deb5594 to b7d1f14 Compare January 23, 2024 10:58
@bors
Copy link
Contributor

bors commented Feb 18, 2024

☔ The latest upstream changes (presumably #3589) made this pull request unmergeable. Please resolve the merge conflicts.

@ydirson
Copy link
Author

ydirson commented Feb 19, 2024

Rebased.

Is there anything I can do to make this PR go forward?

@ydirson ydirson mentioned this pull request Apr 5, 2024
2 tasks
@ydirson ydirson changed the title Freebsd Netlink support for v0.2 [libc-0.2] Freebsd Netlink support backported Apr 5, 2024
There is a conflict of NETLINK_GENERIC definitions between
net/if_mib.h and netlink/netlink.h.  netlink.h is already exported in
the crate root for Linux (and those definitions are already used by at
least crates neli and netlink-packet-route), and if_mib is not much
used yet, so this moves if_mib contents into its own namespace to
leave place for netlink support on FreeBSD (rust-lang#3194).

Module definition moved to the end of file to avoid cryptic style.rs
error "constant found after module when it belongs before".

ctest as of 0.22 cannot be told a given header's symbols live in a
submodule, so let the tests ignore all of them.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
This is an early subset of the Netlink interface, but it
proves sufficient for monitoring changes in IP addresses,
the coverage can be extended later as needed.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
To allow the "Netlink on FreeBSD" feature to be usable before 0.3 gets
released, this builds on top of both the netlink feature patch from rust-lang#3201
if explicitely requested through a feature flag, but by default
provides the ifmib constants where they are located in previous 0.2
releases.

Since this relies on creating the netlink constants in a separate
module, and it seems we cannot check those automatically, avoids
testing them.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
@ydirson
Copy link
Author

ydirson commented May 22, 2024

Rebased to allow replacing current version with cargo patch: 0.2.155

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