fix(router): decode hex-encoded VPC segment in vrfTableID - #442
Merged
Conversation
5a846f8 hex-encoded BGPVRFInstance CRD names (crdnames.VPCSegment) so they pass Kubernetes' lowercase-subdomain name validation, and updated internal/gc's matching logic to account for it, but missed monitor.go's vrfTableID: it split the CRD name and fed the hex segment straight into vrfpkg.TableID, which expects the raw base62 VPC used to build kernel VRF interface names. That built the wrong interface name entirely (e.g. "G00000003eV" instead of the real "G000000010V"), so the kernel VRF table lookup always missed and SEG6 encap routes were never installed for any remote prefix in that VRF — full ICMP loss between cross-site VPC attachments, first surfaced by task verify:ns10's dfw -> sjc failure. vrfTableID now decodes the hex segment back to base62 via intf.HexToBase62 before resolving the table ID, mirroring the decode gc.go already needed for its own CRD-name matching. HexToBase62 naturally errors on the SHA-256 hash-fallback form CRD names fall back to for VPCs that don't cleanly hex-encode, which is correct here too since that form was never recoverable to a real interface name. Adds regression coverage for the hex/base62 round trip, the hash-fallback decode failure, and the pre-existing malformed-name guard.
savme
approved these changes
Aug 21, 2026
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.
Summary
A prior commit hex-encoded VPC identifiers in BGP CRD names to satisfy Kubernetes naming rules, but missed one spot that turned that hex segment back into a kernel VRF interface name expecting the original encoding. The mismatch built the wrong interface name entirely, so the kernel VRF table lookup always missed and SRv6 encap routes were never installed for cross-site VPC traffic — full packet loss between sites sharing a VRF. This restores the correct decode step so the lookup resolves the real interface again.
Test plan