[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #16608 [Core Tor/Tor]: "time published in the consensus network status" seems to be wrong



#16608: "time published in the consensus network status" seems to be wrong
--------------------------+-------------------------------
 Reporter:  toralf        |          Owner:
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.2.???
Component:  Core Tor/Tor  |        Version:  Tor: 0.2.6.10
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+-------------------------------

Comment (by toralf):

 Today I'm sitting at my desktop when I realized this message at the
 server:
 {{{
 Jun 10 11:58:29 ms-magpie Tor[1909]: Our clock is 1 minutes, 31 seconds
 behind the time published in the consensus network status document
 (2016-06-10 10:00:00 UTC).  Tor needs an accurate clock to work correctly.
 Please check your time and date settings! (nowdelta = 0 seconds)
 }}}
 I immediately compared the clock of the server with my desktop clock and a
 radio controlled clock here at home - it was definitely before 11:59 am -
 and it was exactly the same difference than the last time(s) before :91
 sec.
 The log message above it is the result of a slightly patched 0.2.8.3-alpha
 :
 {{{
 # cat /etc/portage/patches/net-misc/tor-0.2.8.3_alpha/nownow.patch
 diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
 index 5a91dda..a360e12 100644
 --- a/src/or/networkstatus.c
 +++ b/src/or/networkstatus.c
 @@ -1480,6 +1480,7 @@ networkstatus_set_current_consensus(const char
 *consensus,
    networkstatus_t *c=NULL;
    int r, result = -1;
    time_t now = time(NULL);
 +  time_t nownow = -1;
    const or_options_t *options = get_options();
    char *unverified_fname = NULL, *consensus_fname = NULL;
    int flav = networkstatus_parse_flavor_name(flavor);
 @@ -1732,16 +1733,20 @@ networkstatus_set_current_consensus(const char
 *consensus,
   * valid-after time, declare that our clock is skewed. */
  #define EARLY_CONSENSUS_NOTICE_SKEW 60

 +       nownow = time(NULL);
    if (now < c->valid_after - EARLY_CONSENSUS_NOTICE_SKEW) {
      char tbuf[ISO_TIME_LEN+1];
      char dbuf[64];
 +    char nowdbuf[64];
      long delta = now - c->valid_after;
 +               long nowdelta = nownow - now;
      format_iso_time(tbuf, c->valid_after);
      format_time_interval(dbuf, sizeof(dbuf), delta);
 +    format_time_interval(nowdbuf, sizeof(nowdbuf), nowdelta);
      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);
 +             "date settings! (nowdelta = %s)", dbuf, tbuf, nowdbuf);
      control_event_general_status(LOG_WARN,
                      "CLOCK_SKEW MIN_SKEW=%ld SOURCE=CONSENSUS", delta);
    }
 }}}
 which was made in the hope to catch an extraterrestrial root cause.

 So again, what is a good explanation for those log messages ?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16608#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs