Add support for Seg6Local encapsulation type#273
Conversation
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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
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.