aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-08-02 13:20:59 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-08-02 13:28:45 -0400
commit5b03c7ba6d899e19e8f3e0a58bd5df8bb7bbf1d0 (patch)
tree646b010f831ecf1fafba65e2ee5d5ff0d819f233 /src/or/main.c
parentc4c5077af2fad107c9fcebdd3a7999da7b8ee904 (diff)
downloadtor-5b03c7ba6d899e19e8f3e0a58bd5df8bb7bbf1d0.tar.gz
tor-5b03c7ba6d899e19e8f3e0a58bd5df8bb7bbf1d0.zip
Fix check_expired_networkstatus_callback() if condition
The condition was always true meaning that we would reconsider updating our directory information every 2 minutes. If valid_until is 6am today, then now - 24h == 1pm yesterday which means that "valid_until < (now - 24h)" is false. But at 6:01am tomorrow, "valid_until < (now - 24h)" becomes true which is that point that we shouldn't trust the consensus anymore. Fixes #23091 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c
index dc23184961..670d67cda1 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1713,7 +1713,7 @@ check_expired_networkstatus_callback(time_t now, const or_options_t *options)
* networkstatus_get_reasonably_live_consensus(), but that value is way
* way too high. Arma: is the bridge issue there resolved yet? -NM */
#define NS_EXPIRY_SLOP (24*60*60)
- if (ns && ns->valid_until < now+NS_EXPIRY_SLOP &&
+ if (ns && ns->valid_until < (now - NS_EXPIRY_SLOP) &&
router_have_minimum_dir_info()) {
router_dir_info_changed();
}