Try IPv4 or IPv6 more often based on public or private IP addresses

Suggested by teor at legacy/trac#17835 (moved):

  1. If the machine has public IPv4 addresses, try IPv4 a lot more often
  2. If the machine has public IPv6 addresses, try IPv6 a lot more often
  3. If the machine has private IPv4 addresses, try IPv4 a little bit more often
  4. If the machine has private IPv6 addresses (excluding link-local addresses), try IPv6 a little bit more often