mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
nodelist: Move the single-hop exit check
Check for single-hop exits in router_add_running_nodes_to_smartlist(), rather than router_choose_random_node(). Part of 34200.
This commit is contained in:
parent
4bcec38fce
commit
ce11e3bf69
@ -985,12 +985,7 @@ router_choose_random_node(smartlist_t *excludedsmartlist,
|
|||||||
(need_guard ? WEIGHT_FOR_GUARD : WEIGHT_FOR_MID);
|
(need_guard ? WEIGHT_FOR_GUARD : WEIGHT_FOR_MID);
|
||||||
|
|
||||||
SMARTLIST_FOREACH_BEGIN(node_list, const node_t *, node) {
|
SMARTLIST_FOREACH_BEGIN(node_list, const node_t *, node) {
|
||||||
if (node_allows_single_hop_exits(node)) {
|
if (rendezvous_v3 &&
|
||||||
/* Exclude relays that allow single hop exit circuits. This is an
|
|
||||||
* obsolete option since 0.2.9.2-alpha and done by default in
|
|
||||||
* 0.3.1.0-alpha. */
|
|
||||||
smartlist_add(excludednodes, (node_t*)node);
|
|
||||||
} else if (rendezvous_v3 &&
|
|
||||||
!node_supports_v3_rendezvous_point(node)) {
|
!node_supports_v3_rendezvous_point(node)) {
|
||||||
/* Exclude relays that can not become a rendezvous for a hidden service
|
/* Exclude relays that can not become a rendezvous for a hidden service
|
||||||
* version 3. */
|
* version 3. */
|
||||||
|
@ -541,6 +541,11 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, int need_uptime,
|
|||||||
/* Don't choose nodes if we are certain they can't do ntor. */
|
/* Don't choose nodes if we are certain they can't do ntor. */
|
||||||
if ((node->ri || node->md) && !node_has_curve25519_onion_key(node))
|
if ((node->ri || node->md) && !node_has_curve25519_onion_key(node))
|
||||||
continue;
|
continue;
|
||||||
|
/* Exclude relays that allow single hop exit circuits. This is an
|
||||||
|
* obsolete option since 0.2.9.2-alpha and done by default in
|
||||||
|
* 0.3.1.0-alpha. */
|
||||||
|
if (node_allows_single_hop_exits(node))
|
||||||
|
continue;
|
||||||
/* Choose a node with an OR address that matches the firewall rules */
|
/* Choose a node with an OR address that matches the firewall rules */
|
||||||
if (direct_conn && check_reach &&
|
if (direct_conn && check_reach &&
|
||||||
!fascist_firewall_allows_node(node,
|
!fascist_firewall_allows_node(node,
|
||||||
|
Loading…
Reference in New Issue
Block a user