From cab05a84cd1504bc4929207a1f33b266744e5dca Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 29 Apr 2020 20:10:14 +1000 Subject: relay: Add IP version tests for circuit extends Add IPv4-only and IPv6-only tests for circuit_open_connection_for_extend(). Part of 33817. --- src/feature/relay/router.c | 4 ++-- src/feature/relay/router.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/feature/relay') diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index 89e232ccc0..b0a56012db 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -1491,8 +1491,8 @@ router_get_advertised_ipv6_or_ap(const or_options_t *options, } /** Returns true if this router has an advertised IPv6 ORPort. */ -bool -router_has_advertised_ipv6_orport(const or_options_t *options) +MOCK_IMPL(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); diff --git a/src/feature/relay/router.h b/src/feature/relay/router.h index c3a93cc0aa..1a262a6799 100644 --- a/src/feature/relay/router.h +++ b/src/feature/relay/router.h @@ -68,7 +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); -bool router_has_advertised_ipv6_orport(const or_options_t *options); +MOCK_DECL(bool, router_has_advertised_ipv6_orport,( + 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, -- cgit v1.2.3-54-g00ecf