diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-21 12:34:56 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-21 12:47:33 -0400 |
commit | f478080bd08033473dfedcf0f51f0be767b985f5 (patch) | |
tree | 74cd3af16cd6e9f2572a88e262a7ae88642c6141 /src/core/mainloop | |
parent | 39146383fc30ee7cce61e3d5d753ae8605dddc22 (diff) | |
download | tor-f478080bd08033473dfedcf0f51f0be767b985f5.tar.gz tor-f478080bd08033473dfedcf0f51f0be767b985f5.zip |
Combine router_get_advertised_or_port{,by_af_}() functions
Diffstat (limited to 'src/core/mainloop')
-rw-r--r-- | src/core/mainloop/connection.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index b3c5e6f51c..0fc5e6a88b 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -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 |