feat: add SEG6_LOCAL_FLAVORS support for seg6local NEXT-CSID#1199
feat: add SEG6_LOCAL_FLAVORS support for seg6local NEXT-CSID#1199privateip wants to merge 2 commits into
Conversation
Add the SEG6_LOCAL_FLAVORS attribute and its nested sub-attributes (SEG6_LOCAL_FLV_OPERATION, SEG6_LOCAL_FLV_LCBLOCK_BITS, SEG6_LOCAL_FLV_LCNODE_FN_BITS), introduced in Linux 6.1 (commit 848f3c0d47, "seg6: add support for the SRv6 End* flavors"). This exposes the NEXT-CSID flavor operation on SEG6LocalEncap, letting callers configure the locator-block and node-function bit lengths used for compressed SID (uSID/C-SID) behaviors, matching what iproute2 exposes as `flavors next-csid lblen <n> nflen <n>`.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds SEG6_LOCAL_FLAVORS support across netlink constants, SEG6LocalEncap encoding/decoding and formatting, and test coverage for flavor round-tripping and string output. ChangesSEG6 Local Flavors Support
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant SEG6LocalEncap
participant nl as nl package
Caller->>SEG6LocalEncap: Decode(attrs)
SEG6LocalEncap->>nl: parse SEG6_LOCAL_FLAVORS sub-attrs
nl-->>SEG6LocalEncap: Operation, LcBlockBits, LcNodeFnBits
SEG6LocalEncap-->>Caller: Flavors populated
Caller->>SEG6LocalEncap: Encode()
SEG6LocalEncap->>nl: emit SEG6_LOCAL_FLAVORS attrs
nl-->>Caller: encoded bytes
Caller->>SEG6LocalEncap: String()
SEG6LocalEncap->>nl: SEG6LocalFlavorOperationString(op)
nl-->>SEG6LocalEncap: operation name
SEG6LocalEncap-->>Caller: formatted string
Related PRs: None specified. Suggested labels: enhancement, seg6 Suggested reviewers: vishvananda Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@route_linux.go`:
- Around line 356-373: The unknown-attribute error in the SEG6_LOCAL_FLAVORS
decode path is formatting the wrong value with %d, because flvAttr.Attr is a
syscall.RtAttr struct rather than the attribute type. Update the error
construction in the SEG6_LOCAL_FLAVORS case to report flvAttr.Attr.Type instead,
matching the intended behavior and avoiding confusing Len/Type output; use the
same pattern as the other SEG6_LOCAL_* decoding branches.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9b4debca-a495-4d77-a39c-181b8a2932db
📒 Files selected for processing (3)
nl/seg6local_linux.goroute_linux.goroute_test.go
- Report flvAttr.Attr.Type rather than the raw syscall.RtAttr struct in the SEG6_LOCAL_FLAVORS unknown-attribute error - Prevents %d from printing the struct's Len/Type fields together, which produced a confusing error message
Add the SEG6_LOCAL_FLAVORS attribute and its nested sub-attributes (SEG6_LOCAL_FLV_OPERATION, SEG6_LOCAL_FLV_LCBLOCK_BITS, SEG6_LOCAL_FLV_LCNODE_FN_BITS), introduced in Linux 6.1 (commit 848f3c0d47, "seg6: add support for the SRv6 End* flavors").
This exposes the NEXT-CSID flavor operation on SEG6LocalEncap, letting callers configure the locator-block and node-function bit lengths used for compressed SID (uSID/C-SID) behaviors, matching what iproute2 exposes as
flavors next-csid lblen <n> nflen <n>.Summary by CodeRabbit
New Features
Tests