2 minor findings · 4 suggestions
Findings
[minor] · Proxy exemption misses private broadcast's IPv4/IPv6-over-Tor path
With private broadcast enabled and only an onion proxy configured, automatic route detection can exclude an IP family from broadcast destinations even though those connections would use Tor.
Location: src/init.cpp:2385 (head).
Details and suggested fix
The exemption checks only GetProxy(net) for the IP family. With -privatebroadcast and an onion proxy supplied by -onion or torcontrol, no IP-family proxy or -onlynet, and automatic outbound connections enabled, both IP families remain automatically managed. If one family's probes report no route while the other reports a route, CheckReachability() removes it from g_reachable_nets. After a successful outbound Tor VERSION exchange enables ProxyForIPv4or6(), private broadcast could reach that family through the onion proxy, but PickNetwork() still excludes it based on the shared membership. On an IPv6-only host this excludes IPv4 destinations; newly gossiped addresses for the removed family also stop entering AddrMan. Private broadcast is off by default, and onion and configured I2P choices remain available, so this reduces destinations rather than leaking transactions or necessarily stalling broadcast. Keep automatic local-route state separate from explicit network policy and let the Tor override bypass only the former. An init-time onion-proxy exemption alone would miss proxies installed later by torcontrol.
[minor] · The first route check can make fixed-seed loading skip IPv6 for the run
If the one-minute check removes IPv6 before the one-shot fixed-seed fallback, that fallback can consume its flag without loading IPv6 seeds, delaying IPv6 bootstrap after recovery.
Location: src/net.h:106 (head).
Details and suggested fix
The one-minute delay does not guarantee the fixed-seed protection described here. ThreadOpenConnections() also waits about one minute when DNS seeding is enabled, using a strict comparison against second-truncated time after its sleep, reconnections and outbound semaphore acquisition. If detection runs first while IPv6 has no route and IPv4 does, GetReachableEmptyNetworks() excludes IPv6. With fixed seeds enabled, DNS seeding still unproductive and another reachable network empty in AddrMan, the fallback loads seeds only for the remaining networks and clears the single add_fixed_seeds flag. A later successful IPv6 check only restores reachability membership, so the fixed-seed fallback never loads the skipped IPv6 seeds during that run. Address gossip or other address sources can still populate IPv6 after recovery; no production occurrence was identified. Track fixed-seed loading per network so a recovered, empty network can receive its seeds.
Optional improvements
[suggestion] · One negative probe outweighs inconclusive results for the other destinations
A destination-specific negative combined with inconclusive probes can disable an entire IP family; requiring every probe to be conclusively negative would preserve the intended conservative behavior.
Location: src/common/netif.cpp:490 (head).
Details and suggested fix
HasGlobalRoute() returns false for results such as {false, nullopt, nullopt} because unknown results do not undo the recorded negative. Unknown results can arise from unrelated socket errors or failure to inspect the selected source address. A route failure specific to one destination can therefore determine the whole family's classification despite probing unrelated prefixes, and CheckReachability() removes that family if the other family reports a route. Return true if any probe succeeds, false only if every probe conclusively reports no route, and nullopt otherwise. This preserves detection for fully negative results while leaving membership unchanged when destination evidence is incomplete. No current environment producing these mixed results was identified, and a later successful check restores the family.
[suggestion] · Route classification and automatic reachability transitions lack deterministic tests
Existing reachability tests manipulate membership directly, leaving the new error classification, source filtering, aggregation, offline guard and recovery behavior without regression coverage.
Location: src/net.cpp:4354 (head).
Details and suggested fix
The LimitedAndReachable_* tests call g_reachable_nets.Add/Remove rather than exercising HasGlobalRoute() or CheckReachability(). They would not detect removal of the any_route guard, classification of unrelated errors such as EACCES as no-route, or failure to re-add a recovered family. Add deterministic probe tests using the replaceable CreateSock factory, following the fake UDP socket pattern in pcp_tests.cpp, to control connect errors and selected source addresses. Cover loopback, link-local and usable sources, unknown errors and mixed destination results. Extracting the transition decision into a pure helper would also allow table-driven assertions for offline preservation, one-family removal, unknown results leaving membership unchanged, recovery and unmanaged networks remaining untouched.
[suggestion] · The detection opt-out also requires maintaining a network allowlist
Using -onlynet to disable detection requires listing every desired network; listing only IPv4 and IPv6 also disables automatic onion connections.
Location: src/init.cpp:2383 (head).
Details and suggested fix
The release note advertises -onlynet as the opt-out, but it clears reachability membership and restores only the listed networks. A user working around a false no-route result with -onlynet=ipv4 -onlynet=ipv6 also excludes onion, even with an onion proxy, and torcontrol will not add it back. Preserving other configured networks requires listing them too; blindly listing every network is not sufficient because I2P and CJDNS require their accompanying configuration. The other detection exemptions, such as -connect, zero automatic connections or IP-family proxies, change direct outbound behavior. Add a dedicated boolean opt-out so users can disable detection without maintaining this allowlist, and document the interaction in the -onlynet help.
[suggestion] · getnetworkinfo help attributes automatically set limited flags to -onlynet
Automatic route detection can set limited=true for IPv4 or IPv6 without -onlynet, but the RPC help still attributes the flag to that option.
Location: src/net.cpp:4373 (head).
Details and suggested fix
GetNetworksInfo() reports limited as the inverse of g_reachable_nets membership. CheckReachability() now removes IP families dynamically when -onlynet is absent, so users diagnosing that decision can see limited: true alongside help saying “is the network limited using -onlynet?”. The description was already incomplete for unconfigured anonymity networks, but this adds a dynamic case for IPv4 and IPv6. Reword the field description to cover automatic route detection as well as configured network restrictions.