From 56061976dbe148dc615c8072c962ddfc0d719585 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Mon, 9 Feb 2015 01:05:31 -0500 Subject: Recover better when our clock jumps back many hours like might happen for Tails or Whonix users who start with a very wrong hardware clock, use Tor to discover a more accurate time, and then fix their clock. Resolves part of ticket 8766. (There are still some timers in various places that aren't addressed yet.) --- src/or/circuitbuild.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/or/circuitbuild.c') diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index fa5a2f5242..fa9ac5668d 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1049,6 +1049,10 @@ circuit_note_clock_jumped(int seconds_elapsed) "CLOCK_JUMPED"); circuit_mark_all_unused_circs(); circuit_mark_all_dirty_circs_as_unusable(); + if (seconds_elapsed < 0) { + /* Restart all the timers in case we jumped a long way into the past. */ + reset_all_main_loop_timers(); + } } /** Take the 'extend' cell, pull out addr/port plus the onion -- cgit v1.2.3-54-g00ecf