[tor-commits] [tor/master] nodelist: Distinguish client and relay reachability

nickm at torproject.org nickm at torproject.org
Tue Jun 9 19:45:23 UTC 2020


commit caab67d0c27ca44344fec05ec445015d9a6c6ff1
Author: teor <teor at torproject.org>
Date:   Thu Apr 30 14:08:04 2020 +1000

    nodelist: Distinguish client and relay reachability
    
    Change some function names to distinguish between:
    * client first hop reachability (ReachableAddresses)
    * relay port reachability self-tests
    
    This is an automated commit, generated by this command:
    
    ./scripts/maint/rename_c_identifier.py \
            router_skip_or_reachability router_connect_assume_or_reachable \
            router_skip_dir_reachability router_connect_assume_dir_reachable
    
    It was generated with --no-verify, so it probably breaks some commit hooks.
    The commiter should be sure to fix them up in a subsequent commit.
    
    Part of 33222.
---
 src/feature/nodelist/node_select.c | 8 ++++----
 src/feature/nodelist/routerlist.c  | 6 +++---
 src/feature/nodelist/routerlist.h  | 4 ++--
 src/feature/relay/selftest.c       | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/feature/nodelist/node_select.c b/src/feature/nodelist/node_select.c
index e83124841..f1b54b663 100644
--- a/src/feature/nodelist/node_select.c
+++ b/src/feature/nodelist/node_select.c
@@ -321,8 +321,8 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
   overloaded_direct = smartlist_new();
   overloaded_tunnel = smartlist_new();
 
-  const int skip_or_fw = router_skip_or_reachability(options, try_ip_pref);
-  const int skip_dir_fw = router_skip_dir_reachability(options, try_ip_pref);
+  const int skip_or_fw = router_connect_assume_or_reachable(options, try_ip_pref);
+  const int skip_dir_fw = router_connect_assume_dir_reachable(options, try_ip_pref);
   const int must_have_or = dirclient_must_use_begindir(options);
 
   /* Find all the running dirservers we know about. */
@@ -1120,8 +1120,8 @@ router_pick_trusteddirserver_impl(const smartlist_t *sourcelist,
   overloaded_direct = smartlist_new();
   overloaded_tunnel = smartlist_new();
 
-  const int skip_or_fw = router_skip_or_reachability(options, try_ip_pref);
-  const int skip_dir_fw = router_skip_dir_reachability(options, try_ip_pref);
+  const int skip_or_fw = router_connect_assume_or_reachable(options, try_ip_pref);
+  const int skip_dir_fw = router_connect_assume_dir_reachable(options, try_ip_pref);
   const int must_have_or = dirclient_must_use_begindir(options);
 
   SMARTLIST_FOREACH_BEGIN(sourcelist, const dir_server_t *, d)
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c
index 80c1aa689..1cc813f17 100644
--- a/src/feature/nodelist/routerlist.c
+++ b/src/feature/nodelist/routerlist.c
@@ -469,7 +469,7 @@ router_reload_router_list(void)
  * and reachability checks be skipped?
  */
 int
-router_skip_or_reachability(const or_options_t *options, int try_ip_pref)
+router_connect_assume_or_reachable(const or_options_t *options, int try_ip_pref)
 {
   /* Servers always have and prefer IPv4.
    * And if clients are checking against the firewall for reachability only,
@@ -481,7 +481,7 @@ router_skip_or_reachability(const or_options_t *options, int try_ip_pref)
  * and reachability checks be skipped?
  */
 int
-router_skip_dir_reachability(const or_options_t *options, int try_ip_pref)
+router_connect_assume_dir_reachable(const or_options_t *options, int try_ip_pref)
 {
   /* Servers always have and prefer IPv4.
    * And if clients are checking against the firewall for reachability only,
@@ -507,7 +507,7 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, int need_uptime,
                                       int need_desc, int pref_addr,
                                       int direct_conn)
 {
-  const int check_reach = !router_skip_or_reachability(get_options(),
+  const int check_reach = !router_connect_assume_or_reachable(get_options(),
                                                        pref_addr);
   /* XXXX MOVE */
   SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), const node_t *, node) {
diff --git a/src/feature/nodelist/routerlist.h b/src/feature/nodelist/routerlist.h
index 81a234354..56109374f 100644
--- a/src/feature/nodelist/routerlist.h
+++ b/src/feature/nodelist/routerlist.h
@@ -50,8 +50,8 @@ typedef enum was_router_added_t {
 
 int router_reload_router_list(void);
 
-int router_skip_or_reachability(const or_options_t *options, int try_ip_pref);
-int router_skip_dir_reachability(const or_options_t *options, int try_ip_pref);
+int router_connect_assume_or_reachable(const or_options_t *options, int try_ip_pref);
+int router_connect_assume_dir_reachable(const or_options_t *options, int try_ip_pref);
 void router_reset_status_download_failures(void);
 int routers_have_same_or_addrs(const routerinfo_t *r1, const routerinfo_t *r2);
 void router_add_running_nodes_to_smartlist(smartlist_t *sl, int need_uptime,
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index 402ce0e3d..0088ce019 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -137,7 +137,7 @@ extend_info_from_router(const routerinfo_t *r)
   tor_assert(r);
 
   /* Make sure we don't need to check address reachability */
-  tor_assert_nonfatal(router_skip_or_reachability(get_options(), 0));
+  tor_assert_nonfatal(router_connect_assume_or_reachable(get_options(), 0));
 
   const ed25519_public_key_t *ed_id_key;
   if (r->cache_info.signing_key_cert)





More information about the tor-commits mailing list