#36718 netaddress: don't treat multicast addresses as routable
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #36718 netaddress: don't treat multicast addresses as routable | Ready | 0 | Crickets | 7 + 15 tests | |||
|
|
|
|
| |||
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:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| ValeraFinebits (none) | question, scope | Whether the PR is intended only to reject new multicast entries or to prevent multicast connection attempts altogether, given existing entries in addrman remain selectable. | open | answered | no | 2026-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
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