Previously, when disconnecting a peer with a given address we would create a dummy subnet that contains just 1 address (/32 for IPv4 and /128 for IPv6) and would disconnect all peers that belong to this subnet (there may be more than one connection, to a different port).
The problem is that for any non-IPv4 and non-IPv6 address we would create an invalid subnet which would later not match any addresses.
Thus, don’t use a one-host-subnet, but compare the addresses directly. This works for any type of addresses.