aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2016-10-27 15:53:49 +1100
committerteor <teor2345@gmail.com>2016-10-31 17:02:21 +1100
commit3158777d35d8e03fdd77d9c227c2d04538d5fff3 (patch)
treea22123957ec76a74c7d4a29621d82de62a2d68a8 /src/or
parentd81f2b5d81814b296e04e1964acf7eed79327970 (diff)
downloadtor-3158777d35d8e03fdd77d9c227c2d04538d5fff3.tar.gz
tor-3158777d35d8e03fdd77d9c227c2d04538d5fff3.zip
Rename routerstatus_version_supports_ntor to *_supports_extend2_cells
This helps avoid the confusion that caused bug 20472. Bugfix on commit 10aa913 from #19163 in tor-0.2.9.3-alpha.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/networkstatus.c6
-rw-r--r--src/or/routerlist.c14
-rw-r--r--src/or/routerlist.h4
3 files changed, 13 insertions, 11 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index f30fe1607c..49baeb83b7 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -2360,10 +2360,10 @@ client_would_use_router(const routerstatus_t *rs, time_t now,
/* We'd drop it immediately for being too old. */
return 0;
}
- if (!routerstatus_version_supports_ntor(rs, 1)) {
- /* We'd ignore it because it doesn't support ntor.
+ if (!routerstatus_version_supports_extend2_cells(rs, 1)) {
+ /* We'd ignore it because it doesn't support EXTEND2 cells.
* If we don't know the version, download the descriptor so we can
- * check if it supports ntor. */
+ * check if it supports EXTEND2 cells and ntor. */
return 0;
}
return 1;
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 85eb999ad6..56c0522cdc 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2344,9 +2344,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;
- /* Don't choose nodes if we are certain they can't do ntor */
- if (node->rs && !routerstatus_version_supports_ntor(node->rs, 1))
+ /* Don't choose nodes if we are certain they can't do EXTEND2 cells */
+ if (node->rs && !routerstatus_version_supports_extend2_cells(node->rs, 1))
continue;
+ /* 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;
/* Choose a node with an OR address that matches the firewall rules */
@@ -5609,13 +5610,14 @@ routerinfo_has_curve25519_onion_key(const routerinfo_t *ri)
return 1;
}
-/* Is rs running a tor version known to support ntor?
+/* Is rs running a tor version known to support EXTEND2 cells?
* If allow_unknown_versions is true, return true if we can't tell
- * (from a versions line or a protocols line) whether it supports ntor.
+ * (from a versions line or a protocols line) whether it supports extend2
+ * cells.
* Otherwise, return false if the version is unknown. */
int
-routerstatus_version_supports_ntor(const routerstatus_t *rs,
- int allow_unknown_versions)
+routerstatus_version_supports_extend2_cells(const routerstatus_t *rs,
+ int allow_unknown_versions)
{
if (!rs) {
return allow_unknown_versions;
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index 47e5445e57..606e9085ce 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -207,8 +207,8 @@ int routerinfo_incompatible_with_extrainfo(const crypto_pk_t *ri,
signed_descriptor_t *sd,
const char **msg);
int routerinfo_has_curve25519_onion_key(const routerinfo_t *ri);
-int routerstatus_version_supports_ntor(const routerstatus_t *rs,
- int allow_unknown_versions);
+int routerstatus_version_supports_extend2_cells(const routerstatus_t *rs,
+ int allow_unknown_versions);
void routerlist_assert_ok(const routerlist_t *rl);
const char *esc_router_info(const routerinfo_t *router);