[or-cvs] r10752: Fix a crash bug (*the* crash bug?) on authorities. Backport (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Fri Jul 6 18:20:56 UTC 2007


Author: nickm
Date: 2007-07-06 14:20:54 -0400 (Fri, 06 Jul 2007)
New Revision: 10752

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/routerlist.c
Log:
 r13634 at catbus:  nickm | 2007-07-06 14:20:50 -0400
 Fix a crash bug (*the* crash bug?) on authorities.  Backport candidate.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13634] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-07-06 18:20:52 UTC (rev 10751)
+++ tor/trunk/ChangeLog	2007-07-06 18:20:54 UTC (rev 10752)
@@ -31,6 +31,10 @@
     - STREAM NEW events are generated for DNSPort requests and for tunneled
       directory connections. (Patch from Robert Hogan.)
 
+  o Major bugfixes (directory):
+    - Fix a crash bug in directory authorities when we re-number the
+      routerlist while inserting a new router. [Bugfix on 0.1.2.x]
+
   o Minor bugfixes (directory):
     - Fix another crash bug related to extra-info caching.  (Bug found by
       Peter Palfrader.) [Bugfix on 0.2.0.2-alpha]

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-07-06 18:20:52 UTC (rev 10751)
+++ tor/trunk/src/or/routerlist.c	2007-07-06 18:20:54 UTC (rev 10752)
@@ -2423,6 +2423,8 @@
   old_router = rimap_get(routerlist->identity_map,
                          router->cache_info.identity_digest);
   if (old_router) {
+    int have_min_info = router_have_minimum_dir_info(); /* can mess with pos,
+                                                         * so call it now.*/
     int pos = old_router->routerlist_index;
     tor_assert(0 <= pos && pos < smartlist_len(routerlist->routers));
     tor_assert(smartlist_get(routerlist->routers, pos) == old_router);
@@ -2452,10 +2454,8 @@
         router->num_unreachable_notifications =
           old_router->num_unreachable_notifications;
       }
-      if (authdir && !from_cache && !from_fetch &&
-          router_have_minimum_dir_info() &&
-          dirserv_thinks_router_is_blatantly_unreachable(router,
-                                                         time(NULL))) {
+      if (authdir && !from_cache && !from_fetch && have_min_info &&
+          dirserv_thinks_router_is_blatantly_unreachable(router, time(NULL))) {
         if (router->num_unreachable_notifications >= 3) {
           unreachable = 1;
           log_notice(LD_DIR, "Notifying server '%s' that it's unreachable. "



More information about the tor-commits mailing list