]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
re-enable reachability testing stuff.
authorRoger Dingledine <arma@torproject.org>
Tue, 15 Mar 2005 01:44:46 +0000 (01:44 +0000)
committerRoger Dingledine <arma@torproject.org>
Tue, 15 Mar 2005 01:44:46 +0000 (01:44 +0000)
also, consider your ORPort reachable after you've processed a
create cell from any non-local address.

svn:r3763

src/or/circuitbuild.c
src/or/circuituse.c
src/or/router.c

index ddc40559e30543356f56207a2b10e13b19c4dce1..83fc7958620eb6b2e0051b2bd26ad453d7c4be75 100644 (file)
@@ -731,6 +731,13 @@ int onionskin_answer(circuit_t *circ, unsigned char *payload, unsigned char *key
   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 74fea1ed2d216bc8af57399524738d614ce1ce55..7eb5f597c4a8212fba03bf4ca29eadfb30d70337 100644 (file)
@@ -544,14 +544,9 @@ circuit_expire_old_circuits(void)
 /** 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 @@ circuit_testing_failed(circuit_t *circ, int at_last_hop) {
   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 331ec7b0905c8853278ed35a0c794ef3711c16fc..785851682d754cfaff37b47428a9936adef2a1f4 100644 (file)
@@ -374,9 +374,9 @@ int init_keys(void) {
  */
 
 /** 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 @@ void router_dirport_found_reachable(void) {
 /** 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();
 }