Make node_get_pref_ipv6_orport() check addresses in the right order

node_get_pref_ipv6_orport() and node_get_prim_orport() check addresses in the following order:

  • routerinfo / descriptor (modified by rewrite_bridge_address_for_node())
  • routerstatus / consensus
  • microdesc

Clients, bridge clients, and relays usually get the correct address from node_get_pref_ipv6_orport() and node_get_prim_orport(), whether they are using microdescriptors or not.

But there are a few cases when this breaks:

  • bridge clients should only check routerinfo for configured bridges
  • all clients and relays that use microdescs should never check full descriptors (and vice versa, except for the bridge case)
  • all clients and relays that use full descriptors should ignore the IPv6 address in the descriptor
  • all clients and relays that use microdescriptors should ignore the IPv6 address in the microdescriptor, when using a consensus method that puts IPv6 addresses in the microdesc consensus, otherwise they should use the microdescriptor