[or-cvs] re-enable reachability testing stuff.

Roger Dingledine arma at seul.org
Tue Mar 15 01:44:49 UTC 2005


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

Modified Files:
	circuitbuild.c circuituse.c router.c 
Log Message:
re-enable reachability testing stuff.
also, consider your ORPort reachable after you've processed a
create cell from any non-local address.


Index: circuitbuild.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- circuitbuild.c	14 Mar 2005 03:18:34 -0000	1.85
+++ circuitbuild.c	15 Mar 2005 01:44:46 -0000	1.86
@@ -731,6 +731,13 @@
   connection_or_write_cell_to_buf(&cell, circ->p_conn);
   log_fn(LOG_DEBUG,"Finished sending 'created' cell.");
 
+  if (!is_local_IP(circ->p_conn->addr)) {
+    /* record that we could process create cells; presumably this means
+       that create cells can reach us too. */
+    log_fn(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent.");
+    router_orport_found_reachable();
+  }
+
   return 0;
 }
 

Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- circuituse.c	14 Mar 2005 03:18:34 -0000	1.53
+++ circuituse.c	15 Mar 2005 01:44:46 -0000	1.54
@@ -544,14 +544,9 @@
 /** A testing circuit has completed. Take whatever stats we want. */
 static void
 circuit_testing_opened(circuit_t *circ) {
-
   /* For now, we only use testing circuits to see if our ORPort is
-     reachable. So, if this circuit ends at us, remember that. */
-  routerinfo_t *exit = router_get_by_digest(circ->build_state->chosen_exit_digest);
-  if (exit && router_is_me(exit)) {
-    log_fn(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent.");
-    router_orport_found_reachable();
-  }
+     reachable. But we remember reachability in onionskin_answer(),
+     so there's no need to record anything here. Just close the circ. */
   circuit_mark_for_close(circ);
 }
 
@@ -563,7 +558,7 @@
   if (!at_last_hop)
     circuit_launch_by_identity(CIRCUIT_PURPOSE_TESTING, me->identity_digest, 0, 0, 1);
   else
-    log_fn(LOG_NOTICE,"The testing circuit has failed. Guess you're not reachable yet.");
+    log_fn(LOG_INFO,"Our testing circuit (to see if your ORPort is reachable) has failed. I'll try again later.");
 }
 
 /** The circuit <b>circ</b> has just become open. Take the next

Index: router.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- router.c	11 Mar 2005 05:07:31 -0000	1.151
+++ router.c	15 Mar 2005 01:44:46 -0000	1.152
@@ -374,9 +374,9 @@
  */
 
 /** Whether we can reach our ORPort from the outside. */
-static int can_reach_or_port = 1;
+static int can_reach_or_port = 0;
 /** Whether we can reach our DirPort from the outside. */
-static int can_reach_dir_port = 1;
+static int can_reach_dir_port = 0;
 
 void consider_testing_reachability(void) {
   routerinfo_t *me = router_get_my_routerinfo();
@@ -407,8 +407,8 @@
 /** Our router has just moved to a new IP. Reset stats. */
 void server_has_changed_ip(void) {
   stats_n_seconds_working = 0;
-//  can_reach_or_port = 0;
-//  can_reach_dir_port = 0;
+  can_reach_or_port = 0;
+  can_reach_dir_port = 0;
   mark_my_descriptor_dirty();
 }
 



More information about the tor-commits mailing list