feat: IPv6 support for clients and hub (#46) - #159
Merged
Conversation
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.
What
Clients resolve and connect over IPv4 and IPv6; the hub listens dual-stack.
Why
hints.ai_familywas hardcodedAF_INETin all client transports, so anAAAA-only FQDN never connected, and the hub only ever bound IPv4. Closes #46.
How
AF_UNSPEC+ iterate the resolved list until one connects.AF_INET6UDP socket (IPV6_V6ONLY=0,AI_V4MAPPED|AI_ALL), falling back toAF_INETon IPv6-disabled hosts — no fd/epoll churn.listen_endpointhelper (dual-stack open + bind + v4-mapped origin un-map); quic/tls bindin6addr_any, plain tcp stays v4 loopback.connect_urlparses bracketed IPv6 literals ([::1]:7227) for connect and--listen.Testing
make testgreen (402, +17 new: connect_url + listen_endpoint)ip6-localhost) connect over quic/tls; plain tcp correctly v4-loopback only.Notes
Dual-stack chosen over recreating the QUIC socket per resolved family to avoid reworking the static epoll registration. DNS off the hot path is out of scope (deferrable follow-up).