]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Restore proper behavior of netinfo skew check
authorNick Mathewson <nickm@torproject.org>
Thu, 8 Aug 2019 13:15:42 +0000 (09:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 8 Aug 2019 13:15:42 +0000 (09:15 -0400)
My previous fix removed a comparison, which would have caused us to
warn about every skew instead of skews of over an hour.

src/or/channeltls.c

index ea69792f1205657bcdb428954583f38adea4b49f..d44f7191384320c76edb502b6d4ad2bd47b08664 100644 (file)
@@ -1721,7 +1721,7 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan)
   /* Act on apparent skew. */
   /** Warn when we get a netinfo skew with at least this value. */
 #define NETINFO_NOTICE_SKEW 3600
-  if (time_abs(apparent_skew) &&
+  if (time_abs(apparent_skew) > NETINFO_NOTICE_SKEW &&
       router_get_by_id_digest(chan->conn->identity_digest)) {
     int trusted = router_digest_is_trusted_dir(chan->conn->identity_digest);
     clock_skew_warning(TO_CONN(chan->conn), apparent_skew, trusted, LD_GENERAL,