aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-11-16 07:37:49 +0000
committerRoger Dingledine <arma@torproject.org>2007-11-16 07:37:49 +0000
commitd09439872d81046d6edee7a4fa03fc4b68db8ab3 (patch)
treefae34c198da27e1c04cf97b3032b45a4080396bd
parentb669fb7344057e943081e42b6b123a4cd1e25d51 (diff)
downloadtor-d09439872d81046d6edee7a4fa03fc4b68db8ab3.tar
tor-d09439872d81046d6edee7a4fa03fc4b68db8ab3.tar.gz
If we're using bridges or have strictentrynodes set, and our
chosen exit is in the same family as all our bridges/entry guards, then be flexible about families. svn:r12514
-rw-r--r--ChangeLog3
-rw-r--r--src/or/circuitbuild.c11
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ae8872301..6eb820ec5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,9 @@ Changes in version 0.2.0.12-alpha - 2007-11-??
the bridge authority could help us (for example, we don't know
a digest, or there is no bridge authority), don't be so eager to
fall back to asking the bridge authority.
+ - If we're using bridges or have strictentrynodes set, and our
+ chosen exit is in the same family as all our bridges/entry guards,
+ then be flexible about families.
o Minor features:
- When we negotiate a v2 OR connection (not yet implemented), accept
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 82ebc28d7..6b159ec6f 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2443,10 +2443,12 @@ choose_random_entry(cpath_build_state_t *state)
routerinfo_t *r = NULL;
int need_uptime = state ? state->need_uptime : 0;
int need_capacity = state ? state->need_capacity : 0;
+ int consider_exit_family = 0;
if (chosen_exit) {
smartlist_add(exit_family, chosen_exit);
routerlist_add_family(exit_family, chosen_exit);
+ consider_exit_family = 1;
}
if (!entry_guards)
@@ -2465,7 +2467,7 @@ choose_random_entry(cpath_build_state_t *state)
SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
{
r = entry_is_live(entry, need_uptime, need_capacity, 0);
- if (r && !smartlist_isin(exit_family, r)) {
+ if (r && (!consider_exit_family || !smartlist_isin(exit_family, r))) {
smartlist_add(live_entry_guards, r);
if (!entry->made_contact) {
/* Always start with the first not-yet-contacted entry
@@ -2504,6 +2506,13 @@ choose_random_entry(cpath_build_state_t *state)
need_capacity = 0;
goto retry;
}
+ if (!r && !can_grow_entry_list(options) && consider_exit_family) {
+ /* still no? if we're using bridges or have strictentrynodes
+ * set, and our chosen exit is in the same family as all our
+ * bridges/entry guards, then be flexible about families. */
+ consider_exit_family = 0;
+ goto retry;
+ }
/* live_entry_guards may be empty below. Oh well, we tried. */
}