Skip to content

freebsd: move net/if_mib.h to src/new module#5325

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

freebsd: move net/if_mib.h to src/new module#5325
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:freebsd-ifmib

Conversation

@dybucc

@dybucc dybucc commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates #3367 by rebasing onto latest main and adjusting the solution
to fit the plan outlined at 1.

The patch itself moves the net/if_mib.h definitions that overlap with those of
netlink/netlink.h into a module of their own under the new module. This is
to avoid blocking future additions of netlink.h API, which seems more
prevalent according to the author of #3367.

This should unblock #3201.

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

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.) `if_mib` does not seem
to be too widely used just yet, so this moves the `if_mib` module
contents into a namespace of their own to make space for `netlink`
support on FreeBSD (rust-lang#3194.)

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 O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-bsd O-freebsd O-unix 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