mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Combine router_get_advertised_or_port{,by_af_}() functions
This commit is contained in:
@@ -3168,9 +3168,9 @@ retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol)
|
||||
smartlist_t *replacements = smartlist_new();
|
||||
const or_options_t *options = get_options();
|
||||
int retval = 0;
|
||||
const uint16_t old_or_port = router_get_advertised_or_port(options);
|
||||
const uint16_t old_or_port = router_get_advertised_or_port(options, AF_INET);
|
||||
const uint16_t old_or_port_ipv6 =
|
||||
router_get_advertised_or_port_by_af(options,AF_INET6);
|
||||
router_get_advertised_or_port(options,AF_INET6);
|
||||
const uint16_t old_dir_port = router_get_advertised_dir_port(options, 0);
|
||||
|
||||
SMARTLIST_FOREACH_BEGIN(get_connection_array(), connection_t *, conn) {
|
||||
@@ -3241,9 +3241,8 @@ retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol)
|
||||
SMARTLIST_FOREACH(replacements, listener_replacement_t *, r, tor_free(r));
|
||||
smartlist_free(replacements);
|
||||
|
||||
if (old_or_port != router_get_advertised_or_port(options) ||
|
||||
old_or_port_ipv6 != router_get_advertised_or_port_by_af(options,
|
||||
AF_INET6) ||
|
||||
if (old_or_port != router_get_advertised_or_port(options, AF_INET) ||
|
||||
old_or_port_ipv6 != router_get_advertised_or_port(options, AF_INET6) ||
|
||||
old_dir_port != router_get_advertised_dir_port(options, 0)) {
|
||||
/* Our chosen ORPort or DirPort is not what it used to be: the
|
||||
* descriptor we had (if any) should be regenerated. (We won't
|
||||
|
||||
Reference in New Issue
Block a user