diff options
Diffstat (limited to 'src/feature/relay')
-rw-r--r-- | src/feature/relay/circuitbuild_relay.c | 2 | ||||
-rw-r--r-- | src/feature/relay/router.c | 13 | ||||
-rw-r--r-- | src/feature/relay/router.h | 4 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/feature/relay/circuitbuild_relay.c b/src/feature/relay/circuitbuild_relay.c index 75b2767b82..b89866b477 100644 --- a/src/feature/relay/circuitbuild_relay.c +++ b/src/feature/relay/circuitbuild_relay.c @@ -251,7 +251,7 @@ STATIC const tor_addr_port_t * circuit_choose_ip_ap_for_extend(const tor_addr_port_t *ipv4_ap, const tor_addr_port_t *ipv6_ap) { - const bool ipv6_supported = router_has_advertised_ipv6_orport(get_options()); + const bool ipv6_supported = router_can_extend_over_ipv6(get_options()); /* If IPv6 is not supported, we can't use the IPv6 address. */ if (!ipv6_supported) { diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index b0a56012db..2858371af5 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -1491,14 +1491,23 @@ router_get_advertised_ipv6_or_ap(const or_options_t *options, } /** Returns true if this router has an advertised IPv6 ORPort. */ -MOCK_IMPL(bool, -router_has_advertised_ipv6_orport,(const or_options_t *options)) +bool +router_has_advertised_ipv6_orport(const or_options_t *options) { tor_addr_port_t ipv6_ap; router_get_advertised_ipv6_or_ap(options, &ipv6_ap); return tor_addr_port_is_valid_ap(&ipv6_ap, 0); } +/** Returns true if this router has an advertised IPv6 ORPort. */ +MOCK_IMPL(bool, +router_can_extend_over_ipv6,(const or_options_t *options)) +{ + /* We might add some extra checks here, such as ExtendAllowIPv6Addresses + * from ticket 33818. */ + return router_has_advertised_ipv6_orport(options); +} + /** Return the port that we should advertise as our DirPort; * this is one of three possibilities: * The one that is passed as <b>dirport</b> if the DirPort option is 0, or diff --git a/src/feature/relay/router.h b/src/feature/relay/router.h index 1a262a6799..39c550dd25 100644 --- a/src/feature/relay/router.h +++ b/src/feature/relay/router.h @@ -68,8 +68,8 @@ uint16_t router_get_active_listener_port_by_type_af(int listener_type, uint16_t router_get_advertised_or_port(const or_options_t *options); void router_get_advertised_ipv6_or_ap(const or_options_t *options, tor_addr_port_t *ipv6_ap_out); -MOCK_DECL(bool, router_has_advertised_ipv6_orport,( - const or_options_t *options)); +bool router_has_advertised_ipv6_orport(const or_options_t *options); +MOCK_DECL(bool, router_can_extend_over_ipv6,(const or_options_t *options)); uint16_t router_get_advertised_or_port_by_af(const or_options_t *options, sa_family_t family); uint16_t router_get_advertised_dir_port(const or_options_t *options, |