Skip to content

link: vxlan: add localbypass support#166

Merged
cathay4t merged 1 commit into
rust-netlink:mainfrom
cathay4t:main
May 25, 2026
Merged

link: vxlan: add localbypass support#166
cathay4t merged 1 commit into
rust-netlink:mainfrom
cathay4t:main

Conversation

@cathay4t
Copy link
Copy Markdown
Member

Intrduced support for the VXLAN localbypass attribute, which controls
whether the VXLAN localbypass mode is turned on.

This is equivalent to ip link add name NAME type vxlan id VNI [no]localbypass.

Intrduced support for the VXLAN localbypass attribute, which controls
whether the VXLAN localbypass mode is turned on.

This is equivalent to `ip link add name NAME type vxlan id VNI
[no]localbypass`.

Signed-off-by: Gris Ge <cnfourt@gmail.com>
@cathay4t cathay4t merged commit cf0a5c8 into rust-netlink:main May 25, 2026
6 checks passed
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 adds the localbypass attribute to VXLAN link messages by implementing a new method in the LinkMessageBuilder. The reviewer suggested using standard Rust doc comments (///) for the new method to ensure proper documentation generation and recommended adding a unit test to verify the serialization of the new attribute.

Comment thread src/link/vxlan.rs
self.append_info_data(InfoVxlan::CollectMetadata(collect_metadata))
}

// Adds the `localbypass` attribute to the VXLAN
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The documentation comment for localbypass starts with // instead of ///. In Rust, /// is the standard prefix for doc comments that are parsed by rustdoc. Using // will prevent this line from appearing in the generated documentation.

Suggested change
// Adds the `localbypass` attribute to the VXLAN
/// Adds the localbypass attribute to the VXLAN
References
  1. In Rust, /// is the standard prefix for doc comments that are parsed by rustdoc. (link)

Comment thread src/link/vxlan.rs
/// This is equivalent to `ip link add name NAME type vxlan id VNI
/// [no]localbypass`. \[no\]localbypass - specifies if the VXLAN
/// localbypass mode is turned on.
pub fn localbypass(self, localbypass: bool) -> Self {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Consider adding a unit test in src/link/test.rs to verify that the localbypass attribute is correctly serialized into the netlink message. While there are currently no VXLAN-specific tests in that file, adding one for this new feature would improve code quality and help prevent regressions.

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.

1 participant