aboutsummaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-08-03 16:08:17 +0300
committerNick Mathewson <nickm@torproject.org>2017-08-08 20:29:34 -0400
commit440eaa9b22573cdb0d38bf5c13200cc1077a453f (patch)
treee8da7041293100baa38324734ab82975152b62a8 /src/or/nodelist.c
parenta561a10da726b426d326515ca7f75988b405bab7 (diff)
downloadtor-440eaa9b22573cdb0d38bf5c13200cc1077a453f.tar.gz
tor-440eaa9b22573cdb0d38bf5c13200cc1077a453f.zip
Correctly assign HSDir flags based on protocol list
In Nick's words: "We want to always return false if the platform is a Tor version, and it is not as new as 0.3.0.8 -- but if the platform is not a Tor version, or if the version is as new as 0.3.0.8, then we want to obey the protocol list. That way, other implementations of our protocol won't have to claim any particular Tor version, and future versions of Tor will have the freedom to drop this protocol in the distant future."
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r--src/or/nodelist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index abbe15ecc2..e900b51455 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -800,9 +800,14 @@ node_supports_v3_hsdir(const node_t *node)
if (node->ri->protocol_list == NULL) {
return 0;
}
+ /* Bug #22447 forces us to filter on tor version:
+ * If platform is a Tor version, and older than 0.3.0.8, return False.
+ * Else, obey the protocol list. */
if (node->ri->platform) {
- /* Bug #22447 forces us to filter on this version. */
- return tor_version_as_new_as(node->ri->platform, "0.3.0.8");
+ if (!strcmpstart(node->ri->platform, "Tor ") &&
+ !tor_version_as_new_as(node->ri->platform, "0.3.0.8")) {
+ return 0;
+ }
}
return protocol_list_supports_protocol(node->ri->protocol_list,
PRT_HSDIR, PROTOVER_HSDIR_V3);