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

pull Snan0M wants to merge 1 commits into bitcoin:master from Snan0M:netaddress-multicast-not-routable changing 4 files +22 −5
  1. Snan0M commented at 2:35 PM on October 31, 2026: none

    IsRoutable() doesn't exclude multicast (224.0.0.0/4, ff00::/8), so multicast addresses received over gossip can end up in addrman.

    This adds IsMulticast() and excludes it in IsRoutable().

    Test updates:

    • addrman_getaddr: expected counts change, since its generated addresses include the multicast range.
    • The last asmap test vector was a multicast address. I replaced it with a non-multicast one at the top of the range (same AS).
  2. netaddress: don't treat multicast addresses as routable
    IsRoutable() excluded private, documentation, link-local and other
    special ranges, but not multicast (224.0.0.0/4, ff00::/8). Gossiped
    multicast addresses were therefore accepted into addrman and could be
    selected for outbound connections.
    
    Add CNetAddr::IsMulticast() and exclude it in IsRoutable().
    
    addrman_getaddr generates addresses with every first octet, so the
    expected counts drop by the multicast ones. The last asmap test vector
    was an ff00::/8 address, which now maps to AS0 as unroutable; use a
    non-multicast address at the top of the range instead (same AS).
    d54f486882
  3. DrahtBot commented at 2:35 PM on October 31, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-31 21:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me