aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-02-22 17:54:25 -0500
committerRoger Dingledine <arma@torproject.org>2011-02-22 17:54:25 -0500
commita2727f62494b8a56152214017ac8fb348dd064be (patch)
tree5877e29ad1c928667114b03b8fa8d0b42cee4fb0 /src
parent4f730e4f3f39748e214470357e3d7aff407fe7e0 (diff)
downloadtor-a2727f62494b8a56152214017ac8fb348dd064be.tar
tor-a2727f62494b8a56152214017ac8fb348dd064be.tar.gz
prevent same entry and exit for insane edge case
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 4f8f5fbab..b3c9f0e1b 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -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 &&