Resolve uSID container ownership for zero-node locators - #452
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The logic change is small, directly addresses the reported bug, and is covered by updated and newly added targeted tests for the relevant edge cases.
Pull request overview
Fixes SRv6 uSID/C-SID container ownership resolution when the matched locator has zero node bits (e.g., a /32 “locator-only” advertisement), so such SIDs resolve directly to the locator owner instead of being treated as non-authoritative and falling back to adjacency-SID validation.
Changes:
- Update
SIDIndex.usidContainerOwnerto treatnodeBits<=0locators as a successful match that resolves to the matched locator owner. - Adjust
ValidateExplicitPathtest expectation to accept node-bits=0 locator ownership resolution (no adjacency-SID error). - Add internal tests covering node-bits=0 behavior, including single-owner, conflicting-owner, declared-structure, and nested-locator scenarios.
File summaries
| File | Description |
|---|---|
| pkg/table/sid_validate.go | Changes uSID container ownership resolution for node-bits=0 locators to resolve directly to the locator owner. |
| pkg/table/sid_validate_test.go | Updates explicit-path validation test to expect success when traversing a node-bits=0 locator-owned uSID container. |
| pkg/table/sid_validate_internal_test.go | Adds focused unit tests for node-bits=0 locator ownership semantics and edge cases. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix uSID container ownership resolution for zero-node locators.
Type of change
How was this tested?
make ciChecklist
make cipasses locally