Skip to content

fix: validate SRv6Locator format in parseConf#183

Merged
privateip merged 1 commit into
mainfrom
fix/issue-160
Jun 30, 2026
Merged

fix: validate SRv6Locator format in parseConf#183
privateip merged 1 commit into
mainfrom
fix/issue-160

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Add validation for the srv6_locator CNI config field in parseConf so malformed values fail fast at config parse time, before any kernel state is created. This prevents late-stage failures deep in the stack that can leave orphaned VRF, veth, and route state.

  • Add isValidSRv6Locator helper that checks for valid IPv6 CIDR prefix with mask length <= 64
  • Call the validator in parseConf after VPC/VPCAttachment checks, before any kernel operations
  • Allow empty or missing srv6_locator since setupSRv6Ingress is a no-op for empty values
  • Add unit tests covering valid/invalid srv6_locator inputs including IPv4 rejection, mask overflow, and non-CIDR strings

fixes #160

Add validation for the srv6_locator CNI config field in parseConf so
malformed values fail fast at config parse time, before any kernel
state is created. This prevents late-stage failures deep in the stack
that can leave orphaned VRF, veth, and route state.

- Add isValidSRv6Locator helper that checks for valid IPv6 CIDR prefix with mask length <= 64
- Call the validator in parseConf after VPC/VPCAttachment checks, before any kernel operations
- Allow empty or missing srv6_locator since setupSRv6Ingress is a no-op for empty values
- Add unit tests covering valid/invalid srv6_locator inputs including IPv4 rejection, mask overflow, and non-CIDR strings

fixes #160
@privateip privateip requested a review from a team as a code owner June 30, 2026 21:58
@privateip privateip requested a review from gaghan430 June 30, 2026 21:58
@privateip privateip merged commit 99644ef into main Jun 30, 2026
5 checks passed
@privateip privateip deleted the fix/issue-160 branch June 30, 2026 22:05
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.

P2: No validation of SRv6Locator format — fails late deep in stack

2 participants