summaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-04-22 16:23:47 +0000
committerNick Mathewson <nickm@torproject.org>2008-04-22 16:23:47 +0000
commit6e979489dce903fdbb086d749e84f43bdb8baaa5 (patch)
treea824d15cfb9c73e969585a0caf53cb9cb9b78c14 /src/or/command.c
parent299014b2c784c0bb72188f4db55d099b69a4e7f4 (diff)
downloadtor-6e979489dce903fdbb086d749e84f43bdb8baaa5.tar.gz
tor-6e979489dce903fdbb086d749e84f43bdb8baaa5.zip
r15269@tombo: nickm | 2008-04-22 12:23:30 -0400
Fix bug 663: warn less verbosely about clock skew from netinfo cells svn:r14408
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/command.c b/src/or/command.c
index d05f6cdae9..79e6133f19 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -523,7 +523,7 @@ command_process_netinfo_cell(cell_t *cell, or_connection_t *conn)
}
if (conn->_base.state != OR_CONN_STATE_OR_HANDSHAKING) {
log_fn(LOG_PROTOCOL_WARN, LD_OR,
- "Received a NETINFO cell on a non-handshaking; dropping.");
+ "Received a NETINFO cell on non-handshaking connection; dropping.");
return;
}
tor_assert(conn->handshake_state &&
@@ -577,8 +577,12 @@ command_process_netinfo_cell(cell_t *cell, or_connection_t *conn)
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;
+ /*XXXX021 be smarter about when everybody says we are skewed. */
+ 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 "