diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-07-07 12:58:47 +1000 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-07-15 09:55:49 +1000 |
commit | 579a80d4ae54ec03fd9b02c4a125b2943770c85d (patch) | |
tree | 816ee00f3ed7dff2fe350d1a2fcb49469baea1ac /src/or/networkstatus.c | |
parent | a76d528bec970e500d3339d9e0f253bded17c338 (diff) | |
download | tor-579a80d4ae54ec03fd9b02c4a125b2943770c85d.tar.gz tor-579a80d4ae54ec03fd9b02c4a125b2943770c85d.zip |
Clients avoid choosing nodes that can't do ntor
If we know a node's version, and it can't do ntor, consider it not running.
If we have a node's descriptor, and it doesn't have a valid ntor key,
consider it not running.
Refactor these checks so they're consistent between authorities and clients.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 61753e5da1..1223788df7 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -2272,8 +2272,10 @@ client_would_use_router(const routerstatus_t *rs, time_t now, /* We'd drop it immediately for being too old. */ return 0; } - if (rs->version_known && !rs->version_supports_extend2_cells) { - /* We'd ignore it because it doesn't support ntor. */ + if (!routerstatus_version_supports_ntor(rs, 1)) { + /* We'd ignore it because it doesn't support ntor. + * If we don't know the version, download the descriptor so we can + * check if it supports ntor. */ return 0; } return 1; |