diff options
author | teor <teor2345@gmail.com> | 2016-08-18 12:02:33 +1000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-08-24 10:07:47 -0400 |
commit | b1ad024d3002e9d8581b6b96c892e5988d9e759b (patch) | |
tree | 3afdc42c8fd5068e6d18a888843b37081c3a6a26 /src/or/routerlist.c | |
parent | d3a975ea05bf8d850602a3ad8054402a679c5dcf (diff) | |
download | tor-b1ad024d3002e9d8581b6b96c892e5988d9e759b.tar.gz tor-b1ad024d3002e9d8581b6b96c892e5988d9e759b.zip |
Fix path selection on firewalled clients
Signed-off-by: teor <teor2345@gmail.com>
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index c3588726f7..64baf4d709 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2017,7 +2017,7 @@ void router_add_running_nodes_to_smartlist(smartlist_t *sl, int allow_invalid, int need_uptime, int need_capacity, int need_guard, int need_desc, - int pref_addr) + int pref_addr, int direct_conn) { const int check_reach = !router_skip_or_reachability(get_options(), pref_addr); @@ -2032,10 +2032,10 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, int allow_invalid, continue; if (node_is_unreliable(node, need_uptime, need_capacity, need_guard)) continue; - /* Choose a node with an OR address that matches the firewall rules */ - if (check_reach && !fascist_firewall_allows_node(node, - FIREWALL_OR_CONNECTION, - pref_addr)) + /* Choose a node with an OR address that matches the firewall rules, + * if we are making a direct connection */ + if (direct_conn && check_reach && + !fascist_firewall_allows_node(node, FIREWALL_OR_CONNECTION, pref_addr)) continue; smartlist_add(sl, (void *)node); @@ -2515,6 +2515,7 @@ router_choose_random_node(smartlist_t *excludedsmartlist, const int weight_for_exit = (flags & CRN_WEIGHT_AS_EXIT) != 0; const int need_desc = (flags & CRN_NEED_DESC) != 0; const int pref_addr = (flags & CRN_PREF_ADDR) != 0; + const int direct_conn = (flags & CRN_DIRECT_CONN) != 0; smartlist_t *sl=smartlist_new(), *excludednodes=smartlist_new(); @@ -2540,7 +2541,8 @@ router_choose_random_node(smartlist_t *excludedsmartlist, router_add_running_nodes_to_smartlist(sl, allow_invalid, need_uptime, need_capacity, - need_guard, need_desc, pref_addr); + need_guard, need_desc, pref_addr, + direct_conn); log_debug(LD_CIRC, "We found %d running nodes.", smartlist_len(sl)); |