aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-09-10 21:40:29 +0000
committerRoger Dingledine <arma@torproject.org>2004-09-10 21:40:29 +0000
commit959199340a8b777f13a6b5ce921d9d8eab9510e0 (patch)
treecce82bedbd69dc6732467e81e71c886597ec5161 /src/or/circuitbuild.c
parent8954cd91ce5055789077c5ae56484638de21ab0a (diff)
downloadtor-959199340a8b777f13a6b5ce921d9d8eab9510e0.tar
tor-959199340a8b777f13a6b5ce921d9d8eab9510e0.tar.gz
don't pick administrative-friends when picking your path
(just a skeleton for now) svn:r2349
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 12b2afe90..7acb876bc 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1074,14 +1074,19 @@ static routerinfo_t *choose_good_middle_server(cpath_build_state_t *state,
log_fn(LOG_DEBUG, "Contemplating intermediate hop: random choice.");
excluded = smartlist_create();
- if((r = router_get_by_digest(state->chosen_exit_digest)))
+ if((r = router_get_by_digest(state->chosen_exit_digest))) {
smartlist_add(excluded, r);
- if((r = routerlist_find_my_routerinfo()))
+ routerlist_add_friends(excluded, r);
+ }
+ if((r = routerlist_find_my_routerinfo())) {
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
+ }
for (i = 0, cpath = head; i < cur_len; ++i, cpath=cpath->next) {
r = router_get_by_digest(cpath->identity_digest);
tor_assert(r);
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
}
choice = router_choose_random_node("", options.ExcludeNodes, excluded,
0, 1, options._AllowUnverified & ALLOW_UNVERIFIED_MIDDLE, 0);
@@ -1095,10 +1100,14 @@ static routerinfo_t *choose_good_entry_server(cpath_build_state_t *state)
smartlist_t *excluded = smartlist_create();
char buf[16];
- if((r = router_get_by_digest(state->chosen_exit_digest)))
+ if((r = router_get_by_digest(state->chosen_exit_digest))) {
smartlist_add(excluded, r);
- if((r = routerlist_find_my_routerinfo()))
+ routerlist_add_friends(excluded, r);
+ }
+ if((r = routerlist_find_my_routerinfo())) {
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
+ }
if(options.FascistFirewall) {
/* exclude all ORs that listen on the wrong port */
routerlist_t *rl;