Repository navigation
Conversation
Tree.Get for an address in 2001::/32 or 2002::/16 returned no value and a wrong prefix when the aliased IPv4 data was in a compressed path. WriteTo expands the paths, so Get was correct only after a write. A compressed path stores its bits and end depth at their position below ::/96. Through an alias, the lookup depth is relative to the alias network, so the walk compared the wrong bits. Get now moves the aliased IPv4 bits to ::/96 when it follows an alias and converts the returned prefix length back to the alias network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Alias lookup and validation node.go, tree_test.go |
Alias lookups use the IPv4 root depth of 96 and adjust the returned prefix length to the original depth. The test checks a compressed /29 path through IPv4, Teredo, and 6to4 addresses before and after WriteTo, and checks broader-network results for addresses outside the path. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to dba0f
-
No actionable merge-blocking risk is established. The change addresses compressed-path alias lookups and adds regression tests; merge after normal checks pass.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "Fix Get through IPv4 aliases into compressed paths" matches the main change. The raw summary and the objectives both describe a fix in Tree.getRecord for lookups through the IPv4 aliases (Teredo 2001::/32 and 6to4 2002::/16) when IPv4 data sits in a compressed path. The added test covers the same scenario, so the title is specific and accurate.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks the IPv4 trail
Through Teredo hops and 6to4 mail
A compressed path is found just right
Then written out and checked in flight
The rabbit thumps: the prefixes align!
Comment @coderabbitai help to get the list of available commands.
Modver resultThis report was generated by Modver, This PR does not require a change in your module’s version number. |
Tree.Getmissed data stored in a compressed path when the lookup went through the Teredo (2001::/32) or 6to4 (2002::/16) IPv4 alias. The lookup kept its depth relative to the alias, but a compressed path stores its bits and end depth at IPv4-subtree depth (96 and deeper), so the walk compared the wrong bits.When
getRecordfollows an alias record, it now copies the aliased IPv4 bytes to bytes 12 to 15 of a new address and walks the IPv4 root from depth 96. It converts the returned prefix length back to the caller's address. All three alias networks are byte-aligned, which a comment notes.The new test inserts
1.2.3.0/29and checks IPv4, Teredo, and 6to4 lookups for hits and for addresses that leave the path, before and afterWriteTo. Without the fix, the alias lookups return nil beforeWriteTo.No CHANGELOG entry: compressed paths are not in v1.2.0, so no released version had this bug.
🤖 Generated with Claude Code
Summary by CodeRabbit