Skip to content

fix: enable the latest rtnetlink on Android #161

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

acst1223
Copy link
Contributor

@acst1223 acst1223 commented Apr 8, 2025

The latest version of the rtnetlink crate cannot compile on Android. The reason is that Android uses the AddressFamily defined in address_family_fallback.rs, while the correct one should be that in address_family_linux.rs. This leads to AddressFamily::Bridge used in rtnetlink being undefined on Android.

This patch fixes this by adding necessary target_os="android" configs. Since libc::AF_IB & libc::AF_MPLS are not defined on Android, we still confine branches related to those enums to only linux and fuchsia.

The latest version of the rtnetlink crate cannot compile on Android.
The reason is that Android uses the AddressFamily defined in
address_family_fallback.rs, while the correct one should be that in
address_family_linux.rs. This leads to AddressFamily::Bridge used in
rtnetlink being undefined on Android.

This patch fixes this by adding necessary target_os="android" configs.
Since libc::AF_IB & libc::AF_MPLS are not defined on Android, we still
confine branches related to those enums to only linux and fuchsia.

Signed-off-by: chenzikai <[email protected]>
Copy link
Member

@cathay4t cathay4t left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@cathay4t cathay4t merged commit d44d500 into rust-netlink:main Apr 8, 2025
8 checks passed
@dignifiedquire
Copy link

This is great news, any chance this could land in a patch release? would love to update to the latest version

@link2xt
Copy link

link2xt commented Apr 30, 2025

This is great news, any chance this could land in a patch release? would love to update to the latest version

I opened #164 for more visibility, would be great to get this into the next iroh release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants