F: try every resolved peer address instead of the first
A peer whose name resolves to both families but which listens on only one of them was reported unreachable, which the documented 0.0.0.0 binding produces on a dual-stack LAN and in the NixOS test network. resolve_target now returns the whole address set (still refusing the name if any address is denied), the HTTP client pins it with resolve_to_addrs so the connector falls through to the next address, and tcp_check tries each address in order with a per-attempt share of the remaining deadline. ClientKey keys on the set. Regression cover: a client test that resolves localhost against a single-family listener, a tests/peers.rs case declaring the peer as http://localhost:<port>, and the VM test's TLS peer gamma now binds 0.0.0.0 (IPv4 only) while alpha and beta stay dual stack. Docs and the contracts section 10 address note describe the new behaviour.
This commit is contained in:
1 parent
3ae8e74a1d
commit
dde6a12ce4
5 files changed
+146
-34
No files matched your search
+8
-7
@@ -51,15 +51,14 @@ let
|
||||
};
|
||||
|
||||
# The test network gives every node an IPv4 and an IPv6 address in
|
||||
# /etc/hosts, and name resolution returns the IPv6 one first, so the nodes
|
||||
# listen on both families. A peer that only listens on one of them is
|
||||
# reported as unreachable.
|
||||
mkNode = { peers }: { ... }: {
|
||||
# /etc/hosts, so a peer name resolves to two addresses. The consolidators
|
||||
# listen on both families; gamma listens on IPv4 only, which is the case that
|
||||
# used to read as unreachable when the transport pinned the first address.
|
||||
mkNode = { peers, bind ? "::" }: { ... }: {
|
||||
imports = [ module ];
|
||||
services.skyg-linux-tracker = {
|
||||
enable = true;
|
||||
inherit port;
|
||||
bind = "::";
|
||||
inherit port bind;
|
||||
openFirewall = true;
|
||||
# A node without peers keeps the feature off: `peers.enable` requires
|
||||
# at least one peer.
|
||||
@@ -117,7 +116,9 @@ pkgs.testers.runNixOSTest {
|
||||
};
|
||||
|
||||
nodes.gamma = { ... }: {
|
||||
imports = [ (mkNode { peers = { }; }) ];
|
||||
# IPv4 only: alpha still reaches it by name, because every resolved
|
||||
# address is tried.
|
||||
imports = [ (mkNode { peers = { }; bind = "0.0.0.0"; }) ];
|
||||
services.skyg-linux-tracker.tls = {
|
||||
enable = true;
|
||||
certFile = "${certs}/cert.pem";
|
||||
|
||||
Reference in new issue
Block a user