]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
A router must be a dir cache before it may be HSDir
authorMatthew Finkel <Matthew.Finkel@gmail.com>
Mon, 25 May 2015 23:09:33 +0000 (23:09 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 18 Dec 2015 18:14:09 +0000 (13:14 -0500)
Fixes #15801

src/or/dirserv.c
src/or/routerlist.c

index fc6899b3c898ab1e8c857015405b6072e4195c80..620d324704288abcda50b9dedb58d3d098f9acb8 100644 (file)
@@ -1350,8 +1350,9 @@ dirserv_thinks_router_is_unreliable(time_t now,
 }
 
 /** Return true iff <b>router</b> should be assigned the "HSDir" flag.
+ *
  * Right now this means it advertises support for it, it has a high uptime,
- * it has a DirPort open, it has the Stable and Fast flag and it's currently
+ * it's a directory cache, it has the Stable and Fast flags, and it's currently
  * considered Running.
  *
  * This function needs to be called after router-\>is_running has
@@ -1378,7 +1379,8 @@ dirserv_thinks_router_is_hs_dir(const routerinfo_t *router,
   else
     uptime = real_uptime(router, now);
 
-  return (router->wants_to_be_hs_dir && router->dir_port &&
+  return (router->wants_to_be_hs_dir &&
+          router->supports_tunnelled_dir_requests &&
           node->is_stable && node->is_fast &&
           uptime >= get_options()->MinUptimeHidServDirectoryV2 &&
           router_is_active(router, node, now));
index 227046b7b18bbf9638f93af14ce31570b411aa25..853c07d58c69dea8e728caa8c8b87e7b52c3db84 100644 (file)
@@ -4905,7 +4905,8 @@ router_differences_are_cosmetic(const routerinfo_t *r1, const routerinfo_t *r2)
        strcasecmp(r1->contact_info, r2->contact_info)) ||
       r1->is_hibernating != r2->is_hibernating ||
       cmp_addr_policies(r1->exit_policy, r2->exit_policy) ||
-      r1->dir_cache != r2->dir_cache)
+      (r1->supports_tunnelled_dir_requests !=
+       r2->supports_tunnelled_dir_requests))
     return 0;
   if ((r1->declared_family == NULL) != (r2->declared_family == NULL))
     return 0;