#36718 netaddress: don't treat multicast addresses as routable

ReviewabilityReviewsAgreementSize
#36718 Snan0M netaddress: don't treat multicast addresses as routableReady0Crickets7 + 15 tests
  • Stop gossiped multicast IP addresses from entering addrman and being dialed
  • Prevents nodes from wasting outbound connection slots on unreachable multicast targets
  • Ready for review
  • No review verdicts recorded
  • No substantive review comments yet
  • Asked whether scope should cover existing addrman entries or just new gossip (ValeraFinebits)
  • 7 lines added or modified outside tests
  • 15 lines added or modified in tests
  • 5 lines removed in total
  • 4 files, 1 commits
P2P#47 of 71
P3 · bug fix
  • P3 because filtering unreachable multicast addresses provides address-hygiene benefits that are deferrable
  • Wasting outbound connection slots on multicast peers is a low-severity edge case
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Adds `CNetAddr::IsMulticast()` for IPv4 (224.0.0.0/4) and IPv6 (FF00::/8) ranges and marks them unroutable in `CNetAddr::IsRoutable()`. This prevents multicast addresses received via P2P addr gossip from being stored in addrman or dialed for outbound connections.

Problem: Bitcoin Core does not identify multicast IP ranges as unroutable, meaning gossiped multicast addresses are admitted into addrman and can waste outbound connection slots on unreachable multicast endpoints.

Evidence of importance:

  • Commit d54f486882: 'Gossiped multicast addresses were therefore accepted into addrman and could be selected for outbound connections.'

Risk of a mistake: low (p2p). A flaw in address classification could inadvertently treat valid public IP addresses as unroutable or vice versa, affecting peer connection selection.

Changed since the previous assessment: Now includes the complete patch showing the implementation of CNetAddr::IsMulticast and test adjustments.

Reviewability

Ready

Nothing known that would invalidate a review now.

Waiting on (from the thread read):

  • author: answer ValeraFinebits's question about the scope regarding existing multicast entries 2026-11-01
  • author: answer to ValeraFinebits' question about PR scope regarding existing addrman entries 2026-11-01

Agreement

Crickets

no substantive comment either way

Thread notes: Initial record. ValeraFinebits asked for clarification regarding the intended scope for existing addrman entries. / Initial record. ValeraFinebits asked a scoping question regarding existing multicast entries in addrman.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
ValeraFinebits (none)question, scopeWhether the PR is intended only to reject new multicast entries or to prevent multicast connection attempts altogether, given existing entries in addrman remain selectable.openansweredno2026-11-01: 'Is this PR intended only to reject new multicast entries, or to prevent multicast connection attempts altogether?'

Participants:

  • ValeraFinebits (none, question, 1 statements 2026-11-01 to 2026-11-01): asked whether the PR intends only to reject new multicast entries or prevent connection attempts altogether

Files

19 lines under test/bench/ci.

  • src/test/netbase_tests.cpp +11/-1
  • src/netaddress.cpp +6/-1
  • src/test/addrman_tests.cpp +4/-3
  • src/netaddress.h +1/-0

Card

The short text the ranking pass compares across PRs.

Classifies IPv4 and IPv6 multicast ranges as unroutable in CNetAddr::IsRoutable(). Multicast addresses received over addr gossip were previously admitted into addrman and could be selected for outbound connection attempts. Unit tests for addrman size expectations and asmap vectors are adjusted to account for multicast exclusion. No dependencies.

Data

dossier JSON · extract JSON · model ledger, generated 2026-11-02T01:12, confidence high, input hash 9bdad910abaae3ef
thread read through 2026-11-01 (1 statements), head d54f486882
labels: none

Categories

P2P

P3 · bug fix

Prevents Bitcoin Core from storing multicast addresses in addrman or dialing them for outbound connections. As noted in commit d54f486882, 'Gossiped multicast addresses were therefore accepted into addrman and could be selected for outbound connections,' which wastes outbound slots on unreachable targets; while useful address-management hygiene, it is reasonably deferrable.

Membership: Modifies CNetAddr routing logic in src/netaddress.cpp to filter out multicast addresses, directly impacting addrman and outbound peer selection.

Factors: security/stability 1, bug 1, performance 0, user value 0, leverage 0