Repository navigation
Conversation
Without -lan, sixup takes the WAN addresses and routes and builds the IPv4 tunnel with its source NAT for the machine it runs on, and forwards nothing: no forwarding sysctls, no RA, DHCPv6 server, NDP proxy, PCP or border firewall, and -nat64 is refused. The WAN's accept_ra is turned off, since a host that forwards nothing would take the RA itself beside sixup. On a line that delegates a prefix but puts none on the link, the host takes its address in the first /64 of the delegation the ISP does not keep for the link (RFC 6603), and a change of that /64 alone is now published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the upstream RA carries a PREF64 (RFC 8781), router or not, sixup builds sixup-clat with 192.0.0.4 (RFC 7335) and an IPv4 default route of last resort through it. bpf/clat.c translates on its egress to the host's CLAT address and sends the IPv6 out of the WAN with bpf_redirect_neigh, and on the WAN's ingress takes what the NAT64 sends that address, and the errors routers on the IPv6 path send it, from 192.0.0.8 (RFC 7600). The address is a stable one in the WAN subnet or the SLAAC prefix, kept on the WAN by its address manager with a preferred lifetime of 0, like a tunnel endpoint. The WAN has to be an Ethernet link. The translation of bpf/nat64.c moves to bpf/xlat.h, which both programs include with their own address mapping and delivery. It now keeps skb->csum right for packets received with CHECKSUM_COMPLETE, as the CLAT's are. The slow path takes the mapping of the program it serves. CI regenerates the BPF objects with a pinned toolchain and fails when they differ from those committed; AGENTS.md gives the same command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
==========================================
+ Coverage 97.06% 97.18% +0.11%
==========================================
Files 33 34 +1
Lines 7291 7455 +164
==========================================
+ Hits 7077 7245 +168
+ Misses 214 210 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…down Two sixups in namespaces of their own: one routes a LAN with -nat64 bpf, and the other, behind it without -lan, learns the PREF64 from its RA alone and reaches an IPv4-only server through its CLAT, with TCP and a fragmented ping through both slow paths. main now waits for the BPF translators to take down their devices and routes before it returns, rather than leaving it to the half second it sleeps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Three commits.
Configure this host alone when no
-lanis given-lan, sixup takes the WAN addresses and routes and builds the IPv4 tunnel with its source NAT for the machine it runs on, and forwards nothing: no forwarding sysctls, no RA, DHCPv6 server, NDP proxy, PCP or border firewall.-nat64is refused.accept_rais turned off, since a host that forwards nothing would take the RA itself beside sixup.Run a CLAT for this host's IPv4 when the line announces a PREF64
sixup-clatwith192.0.0.4(RFC 7335) and an IPv4 default route of last resort (metric 4294967295) through it; any other IPv4 route comes first.bpf/clat.ctranslates on that device's egress to the host's CLAT address and sends the IPv6 out of the WAN withbpf_redirect_neigh; on the WAN's ingress it takes what the NAT64 sends that address, and the errors routers on the IPv6 path send it, as from192.0.0.8(RFC 7600). Everything else on the WAN passes untouched.bpf/nat64.cmoves tobpf/xlat.h, shared with its own address mapping and delivery per program. It now keepsskb->csumright for packets received with CHECKSUM_COMPLETE, as the CLAT's are. The slow path takes the mapping of the program it serves.golang:1.27-alpine3.24) and fails when they differ from those committed; AGENTS.md gives the same command.Test a PLAT and a CLAT of sixup's end to end, and wait for their teardown
-nat64 bpf, and the other, behind it without-lan, learns the PREF64 from its RA alone and reaches an IPv4-only server through its CLAT.mainnow waits for the BPF translators to take down their devices and routes before it returns, rather than leaving it to the half second it sleeps.Test plan
go build ./... && go vet ./... && go test ./..., andgo build ./...for linux, darwin, freebsd and mipsGOOS=linux golangci-lint run, with and without-tags integration-lanagainst the kernel; the CLAT program throughBPF_PROG_TEST_RUN; a host with no IPv4 reaching an IPv4 server through its CLAT and sixup's own NAT64 in another namespace (ping, TCP, UDP with fragments, a fragmented ping through both slow paths, PMTU from the NAT64 and from a router on the IPv6 path, drop reports, teardown); all NAT64 tests after the refactor; new code at 100% coveragego generatein the pinned image reproduces the committed files🤖 Generated with Claude Code