[or-cvs] r14409: Backport: Fix bug 663: warn less verbosely about clock skew (in tor/branches/tor-0_2_0-patches: . src/or)

nickm at seul.org nickm at seul.org
Tue Apr 22 16:23:51 UTC 2008


Author: nickm
Date: 2008-04-22 12:23:51 -0400 (Tue, 22 Apr 2008)
New Revision: 14409

Modified:
   tor/branches/tor-0_2_0-patches/
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/or/command.c
Log:
 r15270 at tombo:  nickm | 2008-04-22 12:23:39 -0400
 Backport: Fix bug 663: warn less verbosely about clock skew from netinfo cells



Property changes on: tor/branches/tor-0_2_0-patches
___________________________________________________________________
 svk:merge ticket from /tor/020 [r15270] on 49666b30-7950-49c5-bedf-9dc8f3168102

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-04-22 16:23:47 UTC (rev 14408)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-04-22 16:23:51 UTC (rev 14409)
@@ -26,6 +26,8 @@
     - Use recursive pthread mutexes in order to avoid deadlock when
       logging debug-level messages to a controller.  Bug spotted by
       nwf, bugfix on 0.2.0.16-alpha.
+    - Warn less verbosely about clock skew from netinfo cells from
+      untrusted sources.  Fixes bug 663.
 
 
 Changes in version 0.2.0.23-rc - 2008-03-24

Modified: tor/branches/tor-0_2_0-patches/src/or/command.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/command.c	2008-04-22 16:23:47 UTC (rev 14408)
+++ tor/branches/tor-0_2_0-patches/src/or/command.c	2008-04-22 16:23:51 UTC (rev 14409)
@@ -577,8 +577,11 @@
   if (labs(apparent_skew) > NETINFO_NOTICE_SKEW &&
       router_get_by_digest(conn->identity_digest)) {
     char dbuf[64];
-    /*XXXX This should check the trustedness of the other side. */
-    int severity = server_mode(get_options()) ? LOG_INFO : LOG_WARN;
+    int severity;
+    if (router_digest_is_trusted_dir(conn->identity_digest))
+      severity = LOG_WARN;
+    else
+      severity = LOG_INFO;
     format_time_interval(dbuf, sizeof(dbuf), apparent_skew);
     log_fn(severity, LD_GENERAL, "Received NETINFO cell with skewed time from "
            "server at %s:%d.  It seems that our clock is %s by %s, or "



More information about the tor-commits mailing list