1 minor finding · 2 suggestions
Findings
[minor] · Persisted multicast entries remain selectable and skip -proxy
After an upgrade, multicast entries retained in peers.dat remain eligible for outbound selection without -onlynet, and attempts now take the direct path instead of the configured IPv4/IPv6 proxy.
Location: src/netaddress.cpp:475 (head).
Details and suggested fix
The new check stops admissions through AddSingle, but AddrManImpl::Unserialize still requires only IsValid() for tried entries and new-bucket placement. Multicast addresses remain valid, so pre-upgrade entries can survive loading. Their new NET_UNROUTABLE classification does not exclude them from default outbound selection because ReachableNets::DefaultNets() includes that network. If an entry passes the ordinary outbound guards, ConnectNode now looks up a proxy for NET_UNROUTABLE, finds none, and calls ConnectDirectly; before this change, the same address used the IPv4/IPv6 proxy. This is an unnecessary direct TCP attempt expected to fail locally, not an established IP leak. The prevalence of multicast entries in deployed peers.dat files is unknown. Require IsRoutable() at both loader checks so upgraded nodes discard these entries; the existing zero-reference pruning removes rejected new-table entries. Add a serialized upgrade fixture containing a multicast entry and an ordinary address and assert that only the latter survives. Construct that fixture directly, since Add() on head now rejects multicast.
Optional improvements
[suggestion] · The replaced AS-map vector leaves multicast mapping unasserted
The replacement keeps near-upper-range coverage but drops the original ff-prefixed interpreter check and does not assert the new multicast-to-AS0 behavior with a loaded map.
Location: src/test/netbase_tests.cpp:671 (head).
Details and suggested fix
The original ffff:d499:8c4b:4941:bc81:d5b9:b51e:85a8 vector checked an expected ASN of 824019. After this change, GetMappedAS returns 0 for that address before calling Interpret, so replacing it with feff:… avoids the changed classification rather than testing it. Keep the original expected-value check by calling Interpret(ASMAP_DATA, ip_bytes) directly with its 16 address bytes, and separately assert that netgroup.GetMappedAS returns 0 for the same multicast address. This preserves the original interpreter input and documents the mapping-layer rule using the existing nonempty-map fixture. The new IsRoutable() literals and the direct fuzzer, which discards the returned ASN, do not provide those assertions.
[suggestion] · The netaddress fuzzer lacks a multicast invariant
The netaddress fuzz target exercises IsMulticast indirectly but lacks an independent assertion tying multicast classification to IPv4/IPv6 and unroutability across arbitrary inputs.
Location: src/netaddress.cpp:404 (head).
Details and suggested fix
ConsumeNetAddr can generate multicast IPv4 and IPv6 addresses, but the fuzz target's generic routability/network assertions would still agree if a later edit removed multicast rejection from IsRoutable(). Add a check following the existing range-predicate convention: when net_addr.IsMulticast() is true, assert net_addr.IsIPv4() || net_addr.IsIPv6(), !net_addr.IsRoutable(), and net_addr.GetNetwork() == Network::NET_UNROUTABLE. This adds an independent relationship check for arbitrary inputs alongside the fixed unit-test literals. The current predicate is correctly guarded; this is fuzz-test hardening.