Skip to content

Fix FreeBSD builds by gating LinkBridgeVlan and Mpls code#162

Open
cathay4t wants to merge 1 commit into
rust-netlink:mainfrom
cathay4t:fix_freebsd
Open

Fix FreeBSD builds by gating LinkBridgeVlan and Mpls code#162
cathay4t wants to merge 1 commit into
rust-netlink:mainfrom
cathay4t:fix_freebsd

Conversation

@cathay4t
Copy link
Copy Markdown
Member

LinkBridgeVlan was unconditionally imported in lib.rs but only
defined on linux/fuchsia/android. Mpls code used AddressFamily::Mpls
which doesn't exist on FreeBSD. Added cfg gates to exclude both
on FreeBSD.

Resolves: #154

@cathay4t
Copy link
Copy Markdown
Member Author

@ydirson Could you help me test this PR in FreeBSD in your use environment/CI?

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates conditional compilation attributes to exclude FreeBSD from MPLS-related route building features and restricts the availability of LinkBridgeVlan to specific operating systems. A review comment pointed out a redundant #[cfg] attribute on a method within an implementation block that is already gated by the same condition in src/route/builder.rs.

Comment thread src/route/builder.rs Outdated
@cathay4t
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates conditional compilation attributes to exclude MPLS-related route builder functionality on FreeBSD, aligning it with existing exclusions for Android. Additionally, it restricts the export of LinkBridgeVlan to specific platforms (Linux, Fuchsia, and Android) and simplifies pattern matching in traffic control tests by removing unused fields. I have no feedback to provide as there were no review comments.

LinkBridgeVlan was unconditionally imported in lib.rs but only
defined on linux/fuchsia/android. Mpls code used AddressFamily::Mpls
which doesn't exist on FreeBSD. Added cfg gates to exclude both
on FreeBSD.

Resolves: rust-netlink#154

Signed-off-by: Gris Ge <cnfourt@gmail.com>
@cathay4t
Copy link
Copy Markdown
Member Author

@ydirson Could you help me test this PR in FreeBSD in your use environment/CI?

@ydirson
Copy link
Copy Markdown
Contributor

ydirson commented May 13, 2026

@ydirson Could you help me test this PR in FreeBSD in your use environment/CI?

I'll be able to test next week

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.

Mpls and LinkBridgeVlan introduction break FreeBSD builds

2 participants