Skip to content

Add support for Seg6Local encapsulation type#273

Open
Aperence wants to merge 3 commits into
rust-netlink:mainfrom
Aperence:seg6local
Open

Add support for Seg6Local encapsulation type#273
Aperence wants to merge 3 commits into
rust-netlink:mainfrom
Aperence:seg6local

Conversation

@Aperence

Copy link
Copy Markdown
Contributor

This commit provide support for Seg6Local (https://segment-routing.org/, https://www.segment-routing.net/images/201901-SRv6.pdf). By adding this support, it is now possible to create various SRv6 segments with netlink-packet-route.

This commit adds the support for the following segments: End, End.X, End.T, End.B6, End.B6.Encaps, End.DX2, End.DX6, End.DX4, End.DT6, End.DT4, End.DT46.

The following segments are not yet implemented/tested: End.BM, End.S, End.AS, End.AM, End.BPF.

Further support could be added in the future to implement the remaining segments, but this patch should be a good starting point in my opinion by providing the most common segments.

Additional tests are also included by comparing the resulting messages with messaged captured in wireshark.

This commit provide support for Seg6Local (https://segment-routing.org/,
https://www.segment-routing.net/images/201901-SRv6.pdf).
By adding this support, it is now possible to create various SRv6 segments with
netlink-packet-route.

This commit adds the support for the following segments: End, End.X, End.T, End.B6,
End.B6.Encaps, End.DX2, End.DX6, End.DX4, End.DT6, End.DT4, End.DT46.

The following segments are **not yet** implemented/tested: End.BM, End.S, End.AS, End.AM,
End.BPF.

Further support could be added in the future to implement the remaining segments,
but this patch should be a good starting point in my opinion by providing the most
common segments.

Additional tests are also included by comparing the resulting messages with messaged captured in wireshark.

Signed-off-by: Aperence <anthony.doeraene@hotmail.com>
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.01887% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.02%. Comparing base (1fb4bd7) to head (a84d40d).
⚠️ Report is 57 commits behind head on main.

Files with missing lines Patch % Lines
src/route/seg6local.rs 82.11% 27 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #273      +/-   ##
==========================================
+ Coverage   68.10%   69.02%   +0.91%     
==========================================
  Files         144      148       +4     
  Lines       10103    10809     +706     
==========================================
+ Hits         6881     7461     +580     
- Misses       3222     3348     +126     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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 Seg6Local (Segment Routing over IPv6 Local) routing attributes and actions. It adds the seg6local module containing parsing, serialization, and structure definitions for RouteSeg6LocalIpTunnel, Seg6LocalAction, and SRH (Segment Routing Header), along with comprehensive unit tests. Review feedback suggests replacing a todo!() in the serialization path of RouteSeg6LocalIpTunnel::Unspec with an empty block to prevent runtime panics. Additionally, it is recommended to refactor the recursive push_segments and get_segments helper functions in SRH into iterative implementations using standard slice methods, which simplifies the code and avoids unnecessary heap allocations and cloning.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/route/seg6local.rs Outdated
Comment thread src/route/seg6local.rs
Comment thread src/route/seg6local.rs
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.

1 participant