[tor-commits] [tor/master] Refactor clock skew handling in networkstatus.c

nickm at torproject.org nickm at torproject.org
Thu Sep 14 13:58:27 UTC 2017


commit c0195ccb79a950313801663a1f9d9706ed9aebce
Author: Taylor Yu <catalyst at torproject.org>
Date:   Wed Sep 13 16:44:19 2017 -0500

    Refactor clock skew handling in networkstatus.c
    
    Move the consensus clock skew handling in
    networkstatus_set_current_consensus() to clock_skew_warning().
---
 src/or/networkstatus.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 8b07a8885..7953af1cc 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1989,14 +1989,16 @@ networkstatus_set_current_consensus(const char *consensus,
     char tbuf[ISO_TIME_LEN+1];
     char dbuf[64];
     long delta = now - c->valid_after;
+    char *flavormsg = NULL;
     format_iso_time(tbuf, c->valid_after);
     format_time_interval(dbuf, sizeof(dbuf), delta);
     log_warn(LD_GENERAL, "Our clock is %s behind the time published in the "
              "consensus network status document (%s UTC).  Tor needs an "
              "accurate clock to work correctly. Please check your time and "
              "date settings!", dbuf, tbuf);
-    control_event_general_status(LOG_WARN,
-                    "CLOCK_SKEW MIN_SKEW=%ld SOURCE=CONSENSUS", delta);
+    tor_asprintf(&flavormsg, "%s flavor consensus", flavor);
+    clock_skew_warning(NULL, delta, 1, LD_GENERAL, flavormsg, "CONSENSUS");
+    tor_free(flavormsg);
   }
 
   router_dir_info_changed();





More information about the tor-commits mailing list