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

[or-cvs] r17993: {tor} Discard router descriptors as we load them if they are more (in tor/trunk: . src/or)



Author: arma
Date: 2009-01-06 21:13:42 -0500 (Tue, 06 Jan 2009)
New Revision: 17993

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/routerlist.c
Log:
Discard router descriptors as we load them if they are more than
five days old. Otherwise if Tor is off for a long time and then
starts with cached descriptors, it will try to use the onion
keys in those obsolete descriptors when building circuits. Bugfix
on 0.2.0.x. Fixes bug 887.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2009-01-07 02:10:46 UTC (rev 17992)
+++ tor/trunk/ChangeLog	2009-01-07 02:13:42 UTC (rev 17993)
@@ -1,4 +1,11 @@
 Changes in version 0.2.1.11-alpha - 2009-01-??
+  o Major bugfixes:
+    - Discard router descriptors as we load them if they are more than
+      five days old. Otherwise if Tor is off for a long time and then
+      starts with cached descriptors, it will try to use the onion
+      keys in those obsolete descriptors when building circuits. Bugfix
+      on 0.2.0.x. Fixes bug 887.
+
   o Minor bugfixes:
     - Make outbound DNS packets respect the OutboundBindAddress setting.
       Fixes the bug part of bug 798. Bugfix on 0.1.2.2-alpha.

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2009-01-07 02:10:46 UTC (rev 17992)
+++ tor/trunk/src/or/routerlist.c	2009-01-07 02:13:42 UTC (rev 17993)
@@ -3060,6 +3060,12 @@
     }
   }
 
+  if (!in_consensus && from_cache &&
+      router->cache_info.published_on < time(NULL) - OLD_ROUTER_DESC_MAX_AGE) {
+    *msg = "Router descriptor was really old.";
+    return ROUTER_WAS_NOT_NEW;
+  }
+
   /* We haven't seen a router with this identity before. Add it to the end of
    * the list. */
   routerlist_insert(routerlist, router);