freebsd(13.2): add net/netlink.h support - #5326
Conversation
This comment has been minimized.
This comment has been minimized.
6e16b1d to
05fae27
Compare
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: Adam Martinez <149513579+dybucc@users.noreply.github.com>
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Change ctest-generated test routine and special-case SemVer tests when targetting FreeBSD systems. The situation is fairly exceptional in that we now have a public submodule. This is not ideal for ctest, as it `#include`s or `use`s all symbols (irrespective of header conflicts or item resolution conflicts.) The solution has been implemented in such way that we can fairly easily remove it from the build script once we settle on which of the interfaces to keep post-1.0. The ctest-generated tests now take an input variable that is used to check if we're testing the `net/if_mib.h` header file or the `netlink/netlink.h` header file. This does mean that we currently are running the whole test suite twice, even when only a small subset of the bindings actually differ across runs. The SemVer tests also needed some tweaking. The routine in charge of building up the string that gets written onto the import-only test file had to be expanded with a special case when running the tests for FreeBSD targets. Before just writing out the import as if it were reexported at the crate root level, we check if the line of the plain text file corresponds with any one of the symbols in a hardcoded list of symbols that exist under the `netlink::netlink` public submodule. If so, we instead write out a string that includes a more fine-grained path to that module.
|
The API looks fine from a quick skim, but since there is no hurry, I think it may be worth trying to add support to ctest first so the tricky test setup isn't needed. (It's useful otherwise too.) Sketched some of that up at #5344 |
|
Noted. Since you already pinged some contributor on that issue, I'll wait and |
|
Could you try adding a separate |
|
Either author or blocked, depending on whether that works. @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
☔ The latest upstream changes (possibly #5370) made this pull request unmergeable. Please resolve the merge conflicts. |
Description
This PR updates #3201 with merge conflicts resolved and follows the new plan at
1.
The patch adds support for
netlink.hinterfaces in OpenBSD, where there's anitem 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 separateheaders. 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
ctestto allow skipping module-specificRust items.
Checklist
libc-test/semverhave been updated*LASTor*MAXhave the standarddoc comment
cargo test -p libc-test --target mytarget); especiallyrelevant for platforms that may not be checked in CI
@rustbot label +stable-nominated
Footnotes
https://github.com/rust-lang/libc/pull/3201#issuecomment-4736374182 ↩