diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-21 12:02:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-21 12:02:01 -0400 |
commit | fda9d7f5ed0758957b98d3b16a62bfd785f1917c (patch) | |
tree | 05be8330fd1ce24273ff80c0e070c58eaaf3b9d5 /src/feature/relay/router.c | |
parent | e8497bfaa70ef7ce8c48bc2c5464d6fddb8fcff1 (diff) | |
download | tor-fda9d7f5ed0758957b98d3b16a62bfd785f1917c.tar.gz tor-fda9d7f5ed0758957b98d3b16a62bfd785f1917c.zip |
Rename get_first_advertised_{addr,port}_by_type_af().
Rationale: these don't actually give the first advertised
address/port, but instead give us the first such port that we are
_configured_ to advertise. Putting them in a portconf_ namespace
therefore makes sense.
Similarly, there are no other functions that get the first
configured advertised addr/port, so the "by_type_af()" part is needless.
This is an automated commit, generated by this command:
./scripts/maint/rename_c_identifier.py \
get_first_advertised_addr_by_type_af portconf_get_first_advertised_addr \
get_first_advertised_port_by_type_af portconf_get_first_advertised_port
Diffstat (limited to 'src/feature/relay/router.c')
-rw-r--r-- | src/feature/relay/router.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index c2b01a641d..18d815097f 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -1474,7 +1474,7 @@ uint16_t router_get_advertised_or_port_by_af(const or_options_t *options, sa_family_t family) { - int port = get_first_advertised_port_by_type_af(CONN_TYPE_OR_LISTENER, + int port = portconf_get_first_advertised_port(CONN_TYPE_OR_LISTENER, family); (void)options; @@ -1502,7 +1502,7 @@ router_get_advertised_ipv6_or_ap(const or_options_t *options, tor_addr_make_null(&ipv6_ap_out->addr, AF_INET6); ipv6_ap_out->port = 0; - const tor_addr_t *addr = get_first_advertised_addr_by_type_af( + const tor_addr_t *addr = portconf_get_first_advertised_addr( CONN_TYPE_OR_LISTENER, AF_INET6); const uint16_t port = router_get_advertised_or_port_by_af( @@ -1824,11 +1824,11 @@ router_check_descriptor_address_port_consistency(const tor_addr_t *addr, family = tor_addr_family(addr); /* The first advertised Port may be the magic constant CFG_AUTO_PORT. */ - port_cfg = get_first_advertised_port_by_type_af(listener_type, family); + port_cfg = portconf_get_first_advertised_port(listener_type, family); if (port_cfg != 0 && !port_exists_by_type_addr_port(listener_type, addr, port_cfg, 1)) { const tor_addr_t *port_addr = - get_first_advertised_addr_by_type_af(listener_type, family); + portconf_get_first_advertised_addr(listener_type, family); /* If we're building a descriptor with no advertised address, * something is terribly wrong. */ tor_assert(port_addr); |