Skip to content

atunnel: cover the IPv6 original destination miss - #17

Open
ygao-g wants to merge 1 commit into
fork-753-cleanfrom
fork-753-suggested
Open

atunnel: cover the IPv6 original destination miss#17
ygao-g wants to merge 1 commit into
fork-753-cleanfrom
fork-753-suggested

Conversation

@ygao-g

@ygao-g ygao-g commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Review scratch PR against agent-substrate#753. Not for merge.

fork-753-base is agent-substrate#753's eight commits (head b97ab7c9) rebased onto upstream/main
fe9013a4, so this diff shows only the proposed addition.

agent-substrate#753's TestTCPOriginalDestinationPreservesErrno dials IPv4 in every case, which leaves the
IPv6 half of the family dispatch untested on the failure path: originalIPv6Destination's
errno return and the "IPv6" error label can both regress without a test noticing. The table
now carries the dial network and the expected family per case, and asserts that the error
names the lookup that actually ran.

Measured with sudo go test ./internal/atunnel/ -coverprofile on Linux 6.17 / arm64:

before after
TCPOriginalDestination 82.1% 85.7%
originalIPv6Destination 75.0% 100.0%

That leaves four uncovered statements in original_dst_linux.go: the non-TCP-conn guard, the
SyscallConn failure, the LocalAddr type assertion and the rawConn.Control failure. All
are defensive, and three predate agent-substrate#753.

🤖 Generated with Claude Code

TestTCPOriginalDestinationPreservesErrno only ever dialled IPv4, so
nothing pinned the IPv6 half of the family dispatch on the failure path:
originalIPv6Destination's errno return and the "IPv6" error label could
both regress without a test noticing. The table now carries the dial
network and the expected family per case, and asserts that the error
names the lookup that actually ran.
@ygao-g
ygao-g force-pushed the fork-753-suggested branch from 000c67a to 2822623 Compare September 1, 2026 21:00
@ygao-g
ygao-g changed the base branch from fork-753-base to fork-753-clean September 1, 2026 21:00
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.

1 participant