[tor-commits] [tor/master] Add "internal" to some bootstrap statuses when no exits are available.

nickm at torproject.org nickm at torproject.org
Tue Dec 30 14:08:00 UTC 2014


commit c3a4201faa389ce95b263045a855a556be25f3f2
Author: teor <teor2345 at gmail.com>
Date:   Fri Dec 26 00:43:58 2014 +1100

    Add "internal" to some bootstrap statuses when no exits are available.
    
    If the consensus does not contain Exits, Tor will only build internal
    circuits. In this case, relevant statuses will contain the word "internal"
    as indicated in the Tor control-spec.txt. When bootstrap completes,
    Tor will be ready to handle an application requesting an internal
    circuit to hidden services at ".onion" addresses.
    
    If a future consensus contains Exits, exit circuits may become available.
    
    Tor already notifies the user at "notice" level if they have no exits in
    the consensus, and can therefor only build internal paths.
    
    Consequential change from #13718.
---
 changes/bug13718-add-internal-bootstrap-statuses |    9 +++++++
 src/or/control.c                                 |   30 ++++++++++++++++++----
 2 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/changes/bug13718-add-internal-bootstrap-statuses b/changes/bug13718-add-internal-bootstrap-statuses
new file mode 100644
index 0000000..d3e9a77
--- /dev/null
+++ b/changes/bug13718-add-internal-bootstrap-statuses
@@ -0,0 +1,9 @@
+  o Minor bugfixes:
+    - Add "internal" to some bootstrap statuses when no exits are available.
+      If the consensus does not contain Exits, Tor will only build internal
+      circuits. In this case, relevant statuses will contain the word
+      "internal" as indicated in the Tor control-spec.txt. When bootstrap
+      completes, Tor will be ready to handle an application requesting an
+      internal circuit to hidden services at ".onion" addresses.
+      If a future consensus contains Exits, exit circuits may become available.
+      Consequential change from #13718.
diff --git a/src/or/control.c b/src/or/control.c
index dc67588..7214559 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4807,23 +4807,43 @@ bootstrap_status_to_string(bootstrap_status_t s, const char **tag,
       break;
     case BOOTSTRAP_STATUS_REQUESTING_DESCRIPTORS:
       *tag = "requesting_descriptors";
-      *summary = "Asking for relay descriptors";
+      /* XXXX this appears to incorrectly report internal on most loads */
+      *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+        "Asking for relay descriptors for internal paths" :
+        "Asking for relay descriptors";
       break;
+    /* If we're sure there are no exits in the consensus,
+     * inform the controller by adding "internal"
+     * to the status summaries.
+     * (We only check this while loading descriptors,
+     * so we may not know in the earlier stages.)
+     * But if there are exits, we can't be sure whether
+     * we're creating internal or exit paths/circuits.
+     * XXXX Or should be use different tags or statuses
+     * for internal and exit/all? */
     case BOOTSTRAP_STATUS_LOADING_DESCRIPTORS:
       *tag = "loading_descriptors";
-      *summary = "Loading relay descriptors";
+      *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+        "Loading relay descriptors for internal paths" :
+        "Loading relay descriptors";
       break;
     case BOOTSTRAP_STATUS_CONN_OR:
       *tag = "conn_or";
-      *summary = "Connecting to the Tor network";
+      *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+        "Connecting to the Tor network internally" :
+        "Connecting to the Tor network";
       break;
     case BOOTSTRAP_STATUS_HANDSHAKE_OR:
       *tag = "handshake_or";
-      *summary = "Finishing handshake with first hop";
+      *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+        "Finishing handshake with first hop of internal circuit" :
+        "Finishing handshake with first hop";
       break;
     case BOOTSTRAP_STATUS_CIRCUIT_CREATE:
       *tag = "circuit_create";
-      *summary = "Establishing a Tor circuit";
+      *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+        "Establishing an internal Tor circuit" :
+        "Establishing a Tor circuit";
       break;
     case BOOTSTRAP_STATUS_DONE:
       *tag = "done";





More information about the tor-commits mailing list