[or-cvs] if you"re an auth dir server, always publish your dirport,

arma at seul.org arma at seul.org
Fri Jul 15 18:49:37 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	router.c 
Log Message:
if you're an auth dir server, always publish your dirport,
even if you haven't yet found yourself to be reachable.

this is the cause of Jan Tore Morken's recent or-talk bug.


Index: router.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- router.c	1 Jul 2005 02:01:21 -0000	1.182
+++ router.c	15 Jul 2005 18:49:35 -0000	1.183
@@ -830,6 +830,7 @@
   const char *cp;
   routerinfo_t *ri_tmp;
 #endif
+  or_options_t *options = get_options();
 
   /* Make sure the identity key matches the one in the routerinfo. */
   if (crypto_pk_cmp_keys(ident_key, router->identity_pkey)) {
@@ -888,7 +889,8 @@
     router->nickname,
     router->address,
     router->or_port,
-    check_whether_dirport_reachable() ? router->dir_port : 0,
+    (authdir_mode(options) || check_whether_dirport_reachable()) ?
+      router->dir_port : 0,
     router->platform,
     published,
     fingerprint,
@@ -909,9 +911,9 @@
   /* From now on, we use 'written' to remember the current length of 's'. */
   written = result;
 
-  if (get_options()->ContactInfo && strlen(get_options()->ContactInfo)) {
+  if (options->ContactInfo && strlen(options->ContactInfo)) {
     result = tor_snprintf(s+written,maxlen-written, "contact %s\n",
-                      get_options()->ContactInfo);
+                          options->ContactInfo);
     if (result<0)
       return -1;
     written += result;



More information about the tor-commits mailing list