Use network prefix length to determine which addresses are connectable
This branch uses the network prefix (netmask) to determine whether a contact's IP address is reachable via the LAN interface we're listening on. In theory, failing to check this this could have resulted in connection attempts being routed via a different interface with a LAN address (for example, a NAT address assigned by a mobile carrier), exposing metadata.
Closes #1178 (closed).