Some addresses can be an IPv6 ones with an embedded IPv4 address belongs to. AddrMan::Size(), and so the per-network counts in getaddrmaninfo, use GetNetwork(), which returns ipv6 for these addresses. However, the network filter in GetAddr_() and the network / source_network labels in getnodeaddresses and getrawaddrman use GetNetClass(), which returns ipv4 for them.
So on master, for example, for a node whose addrman holds a 6to4 or Teredo address:
- getaddrmaninfo counts it under ipv6.
- getnodeaddresses 0 "ipv6" doesn't return it.
- getnodeaddresses 0 "ipv4" does return it, labelled ipv4.
This PR changes all of this places to use GetNetwork(). This way the filter, labels and the counts agree. We should leave GetNetClass() usage for netgroup and bucketing decisions, where treating linked-IPv4 addresses as IPv4 is intended. If you pick the change in the fuzz target and run it without the other changes, it's expected to crash to reproduce the issue.