Skip to content

freebsd(13.2): add net/netlink.h support#5326

Open
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:freebsd-netlink
Open

freebsd(13.2): add net/netlink.h support#5326
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:freebsd-netlink

Conversation

@dybucc

@dybucc dybucc commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates #3201 with merge conflicts resolved and follows the new plan at
1.

The patch adds support for netlink.h interfaces in OpenBSD, where there's an
item resolution conflict if we expose the Rust bindings alongside those of
if_mib.h. This set of APIs is "scoped" in C because they live on separate
headers. In rust-lang/libc, we reexport all items at the root crate level, which
makes item resolution fail.

Note this depends on #5325. It won't pass tests but it will build. This is
because the test templates will gather all items in a single file, so item
resolution fails. We can't really skip these items altogether from the tests, so
it may just be necessary to extend ctest to allow skipping module-specific
Rust items.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard
    doc comment
  • Tested locally (cargo test -p libc-test --target mytarget); especially
    relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

Footnotes

  1. https://github.com/rust-lang/libc/pull/3201#issuecomment-4736374182

This is an early subset of the Netlink interface, but it proves
sufficient for monitoring changes in IP addresses. Coverage can be
extended later as needed. See [^1] and [^2].

[^1]:
https://github.com/freebsd/freebsd-src/blob/df9d6403caa6426e92f5e100602f4d2be474bbae/sys/netlink/netlink.h
[^2]:
https://github.com/freebsd/freebsd-src/blob/df9d6403caa6426e92f5e100602f4d2be474bbae/sys/netlink/netlink_generic.h

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>

Co-authored-by: dybucc <149513579+dybucc@users.noreply.github.com>
@rustbot rustbot added O-bsd O-freebsd S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jul 24, 2026
@dybucc dybucc mentioned this pull request Jul 24, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-bsd O-freebsd S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants