Conversation
This was referenced Sep 25, 2026
david-yu
added this pull request to stack #12
September 25, 2026 16:16
A default-constructed socket_address has been AF_UNSPEC since 453d531, but posix_network_stack::listen still turned it into 0.0.0.0, so listen(socket_address{}) — "any address, any port" — was unreachable on an IPv6-only host, with no way to ask for any family. Bind [::] instead where the stack has IPv6, with IPV6_V6ONLY off so IPv4 peers still arrive, and keep 0.0.0.0 on a host without IPv6. A caller who wants exactly one family passes that family's any-address (inet_address(family), ipv4_addr(port), ipv6_addr(port)) or sets listen_options::ipv6_only, which is kept here if it was set explicitly. Tested by listening on socket_address{} and connecting from 127.0.0.1: the listener is AF_INET6 and on the any-address, and the peer reads as IPv4 after unmapping.
david-yu
force-pushed
the
ipv6/09-listen-unspecified
branch
from
September 25, 2026 18:11
6873997 to
20cade1
Compare
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.
Part 9 of 10 of the IPv6 series, split out of #1 and rebased on current
scylladb/seastarmaster. Based on #9, so the diff here is only this PR's commit.Why
A default-constructed
socket_addresshas beenAF_UNSPECsince453d531b0(scylladb/seastar#694), butlisten()still turned it into0.0.0.0, solisten(socket_address{})("any address, any port") was unreachable on an IPv6-only host.What
20cade105) — binds[::]withIPV6_V6ONLYoff where the stack has IPv6, so IPv4 peers still arrive, and0.0.0.0where it does not, both throughinet_address(family)(669685c78) as the IPv4 branch always did. An explicitly setlisten_options::ipv6_onlyis kept.Behaviour change
On a host with IPv6,
listen(socket_address{})binds[::]instead of0.0.0.0. IPv4 clients still connect; the socket reports them as::ffff:a.b.c.d, andhttp_server/rpc::serverunmap them (PR 4).Testing
Listening on
socket_address{}and connecting from127.0.0.1: the listener isAF_INET6on the any-address, and the peer reads as IPv4 after unmapping.On the core-aws VM (Ubuntu 24.04, GCC 14, C++23, RelWithDebInfo, GnuTLS and OpenSSL in one tree), this PR's head builds and passes
dns,ipv6,socket,rpc,httpd,httpd_openssl,tls,tls_openssl,network_interface,websocketandunix_domainwithSEASTAR_TEST_REQUIRE_IPV6=1, so none of their IPv6 cases skipped.Stack