diff options
author | teor <teor@riseup.net> | 2020-05-11 17:12:02 +1000 |
---|---|---|
committer | teor <teor@riseup.net> | 2020-05-18 21:53:52 +1000 |
commit | ce11e3bf6946d1659e5915abac30b1972fc799c8 (patch) | |
tree | 4ef50cff52273cc66bf21c3d84b972eac07a6a0b /src/feature/nodelist/routerlist.c | |
parent | 4bcec38fce7fa401f326f8c611f779dd7f67d8ff (diff) | |
download | tor-ce11e3bf6946d1659e5915abac30b1972fc799c8.tar.gz tor-ce11e3bf6946d1659e5915abac30b1972fc799c8.zip |
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.
Diffstat (limited to 'src/feature/nodelist/routerlist.c')
-rw-r--r-- | src/feature/nodelist/routerlist.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c index 0d3d1bea3e..c18051d416 100644 --- a/src/feature/nodelist/routerlist.c +++ b/src/feature/nodelist/routerlist.c @@ -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. */ if ((node->ri || node->md) && !node_has_curve25519_onion_key(node)) 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 */ if (direct_conn && check_reach && !fascist_firewall_allows_node(node, |