summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-02-08 11:52:53 -0500
committerNick Mathewson <nickm@torproject.org>2021-02-08 11:52:53 -0500
commit56f1cab9c12349538c5526de92d6e64fecb81184 (patch)
tree598bdf309473a346a8435437b933e26fb9c847df /src
parent49c61c1bb85fa557a6a47f41cfab435a82a6d82f (diff)
downloadtor-56f1cab9c12349538c5526de92d6e64fecb81184.tar.gz
tor-56f1cab9c12349538c5526de92d6e64fecb81184.zip
Don't log supported-protover warnings if consensus is older than Tor.
Previously we would warn in this case... but there's really no justification for doing so, and it can only cause confusion. Fixes bug #40281; bugfix on 0.4.0.1-alpha.
Diffstat (limited to 'src')
-rw-r--r--src/feature/nodelist/networkstatus.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c
index e07d58c91c..8e47fafd3c 100644
--- a/src/feature/nodelist/networkstatus.c
+++ b/src/feature/nodelist/networkstatus.c
@@ -2713,6 +2713,13 @@ networkstatus_check_required_protocols(const networkstatus_t *ns,
const bool consensus_postdates_this_release =
ns->valid_after >= tor_get_approx_release_date();
+ if (! consensus_postdates_this_release) {
+ // We can't meaningfully warn about this case: This consensus is from
+ // before we were released, so whatever is says about required or
+ // recommended versions may no longer be true.
+ return 0;
+ }
+
tor_assert(warning_out);
if (client_mode) {
@@ -2730,7 +2737,7 @@ networkstatus_check_required_protocols(const networkstatus_t *ns,
"%s on the Tor network. The missing protocols are: %s",
func, missing);
tor_free(missing);
- return consensus_postdates_this_release ? 1 : 0;
+ return 1;
}
if (! protover_all_supported(recommended, &missing)) {