]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Refactor router_pick_directory_server_impl to use node functions
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>
Sat, 30 Apr 2016 01:00:50 +0000 (11:00 +1000)
committerNick Mathewson <nickm@torproject.org>
Thu, 5 May 2016 12:24:17 +0000 (08:24 -0400)
No behavioural change

This makes the use of the node explicit in the function, rather
than hiding the node lookup in fascist_firewall_allows_rs.

src/or/routerlist.c

index 13739a7c7cb2366ebbda0d394a61a08743c93055..1c275a68c3487e96dd6698431727e719aa9105ea 100644 (file)
@@ -1740,13 +1740,13 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
      * we try routers that only have one address both times.)
      */
     if (!fascistfirewall || skip_or_fw ||
-        fascist_firewall_allows_rs(status, FIREWALL_OR_CONNECTION,
-                                   try_ip_pref))
+        fascist_firewall_allows_node(node, FIREWALL_OR_CONNECTION,
+                                     try_ip_pref))
       smartlist_add(is_trusted ? trusted_tunnel :
                     is_overloaded ? overloaded_tunnel : tunnel, (void*)node);
     else if (!must_have_or && (skip_dir_fw ||
-             fascist_firewall_allows_rs(status, FIREWALL_DIR_CONNECTION,
-                                        try_ip_pref)))
+             fascist_firewall_allows_node(node, FIREWALL_DIR_CONNECTION,
+                                          try_ip_pref)))
       smartlist_add(is_trusted ? trusted_direct :
                     is_overloaded ? overloaded_direct : direct, (void*)node);
   } SMARTLIST_FOREACH_END(node);