Skip to content

fix(router): decode hex-encoded VPC segment in vrfTableID - #442

Merged
privateip merged 1 commit into
mainfrom
fix/vrf-table-id-hex-base62
Aug 21, 2026
Merged

fix(router): decode hex-encoded VPC segment in vrfTableID#442
privateip merged 1 commit into
mainfrom
fix/vrf-table-id-hex-base62

Conversation

@privateip

Copy link
Copy Markdown
Contributor

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

  • Cross-site VPC traffic (same VRF, different nodes) round-trips instead of dropping 100%
  • Unit tests, build, and lint pass

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.
@privateip
privateip requested a review from a team as a code owner August 21, 2026 15:25
@privateip
privateip requested a review from savme August 21, 2026 15:25
@privateip
privateip merged commit c4c2d06 into main Aug 21, 2026
11 checks passed
@privateip
privateip deleted the fix/vrf-table-id-hex-base62 branch August 21, 2026 16:17
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.

2 participants