]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
prevent same entry and exit for insane edge case
authorRoger Dingledine <arma@torproject.org>
Tue, 22 Feb 2011 22:54:25 +0000 (17:54 -0500)
committerRoger Dingledine <arma@torproject.org>
Tue, 22 Feb 2011 22:54:25 +0000 (17:54 -0500)
changes/bug2403 [new file with mode: 0644]
src/or/circuitbuild.c

diff --git a/changes/bug2403 b/changes/bug2403
new file mode 100644 (file)
index 0000000..3b29b37
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes:
+    - In the special case where you configure a public exit relay as your
+      bridge, Tor would be willing to use that exit relay as the last
+      hop in your circuit as well. Now we fail that circuit instead.
+      Bugfix on 0.2.0.12-alpha. Fixes bug 2403. Reported by "piebeer".
+
index 4f8f5fbab0d51e2e387b807f4b1431f2fd958c9e..b3c9f0e1b5a3836d4f1ee9bf66267954338bf666 100644 (file)
@@ -4063,7 +4063,6 @@ choose_random_entry(cpath_build_state_t *state)
   int preferred_min, consider_exit_family = 0;
 
   if (chosen_exit) {
-    smartlist_add(exit_family, chosen_exit);
     routerlist_add_family(exit_family, chosen_exit);
     consider_exit_family = 1;
   }
@@ -4086,6 +4085,8 @@ choose_random_entry(cpath_build_state_t *state)
       r = entry_is_live(entry, need_uptime, need_capacity, 0, &msg);
       if (!r)
         continue; /* down, no point */
+      if (r == chosen_exit)
+        continue; /* don't pick the same node for entry and exit */
       if (consider_exit_family && smartlist_isin(exit_family, r))
         continue; /* avoid relays that are family members of our exit */
       if (options->EntryNodes &&