Skip to content

support veth link type#28

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

support veth link type#28
cathay4t merged 1 commit into
rust-netlink:mainfrom
cathay4t:main

Conversation

@cathay4t

Copy link
Copy Markdown
Member

Introduce veth (virtual ethernet) interface support for both creation
and query. Usage:

ip link add NAME type veth peer PEER_NAME

The peer name is parsed from iface_specific. The display path extracts
the peer name from InfoVeth::Peer LinkMessage attributes and shows it
as 'peer ' in detailed output.

Integration tests cover basic show, detailed show, JSON show, and
detailed JSON show.

Introduce veth (virtual ethernet) interface support for both creation
and query. Usage:

  ip link add NAME type veth peer PEER_NAME

The peer name is parsed from iface_specific. The display path extracts
the peer name from InfoVeth::Peer LinkMessage attributes and shows it
as 'peer <name>' in detailed output.

Integration tests cover basic show, detailed show, JSON show, and
detailed JSON show.

Signed-off-by: Gris Ge <cnfourt@gmail.com>

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

Copy link
Copy Markdown

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 introduces support for veth (Virtual Ethernet) interfaces, including the ability to add links, serialize veth-specific data, and display it in the CLI. Integration tests for veth functionality were also added. Feedback includes a recommendation to validate that no unexpected trailing arguments are provided after the peer name in apply_veth and a suggestion to remove a redundant interface deletion in the test cleanup logic, as deleting one end of a veth pair automatically removes the other.

Comment thread src/ip/link/ifaces/veth.rs
Comment thread src/ip/link/tests/veth.rs Outdated
@cathay4t cathay4t merged commit 865434f into rust-netlink:main May 24, 2026
3 checks passed
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