[or-cvs] r13172: Avoid going directly to the directory authorities even if yo (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Fri Jan 18 04:42:22 UTC 2008


Author: arma
Date: 2008-01-17 23:42:22 -0500 (Thu, 17 Jan 2008)
New Revision: 13172

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/dirserv.c
Log:
Avoid going directly to the directory authorities even if you're a 
relay, if you haven't found yourself reachable yet or if you've
decided not to advertise your dirport yet. Addresses bug 556.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-01-18 04:27:16 UTC (rev 13171)
+++ tor/trunk/ChangeLog	2008-01-18 04:42:22 UTC (rev 13172)
@@ -1,3 +1,10 @@
+Changes in version 0.2.0.18-alpha - 2008-01-??
+  o Major features:
+    - Avoid going directly to the directory authorities even if you're a
+      relay, if you haven't found yourself reachable yet or if you've
+      decided not to advertise your dirport yet. Addresses bug 556.
+
+
 Changes in version 0.2.0.17-alpha - 2008-01-17
   o Compile fixes:
     - Make the tor-gencert man page get included correctly in the tarball.

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2008-01-18 04:27:16 UTC (rev 13171)
+++ tor/trunk/src/or/dirserv.c	2008-01-18 04:42:22 UTC (rev 13172)
@@ -1116,16 +1116,18 @@
 int
 directory_fetches_from_authorities(or_options_t *options)
 {
+  routerinfo_t *me;
   if (options->FetchDirInfoEarly)
     return 1;
   if (options->DirPort == 0)
     return 0;
   if (options->BridgeRelay == 1)
     return 0;
-  /* XXX if dirport not advertised, return 0 too */
-  if (!server_mode(options))
+  if (!server_mode(options) || !advertised_server_mode())
     return 0;
-  /* XXX if orport or dirport not reachable, return 0 too */
+  me = router_get_my_routerinfo();
+  if (!me || !me->dir_port)
+    return 0; /* if dirport not advertised, return 0 too */
   return 1;
 }
 



More information about the tor-commits mailing list