summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-07-06 18:20:54 +0000
committerNick Mathewson <nickm@torproject.org>2007-07-06 18:20:54 +0000
commite6ba07f8f57f19cf82299fc61dac3435ec4d6e64 (patch)
treeee7532a938c8d006002121a922ea12b0e6079c15
parent92b6e090825575e94b2497df58d11df532f3415c (diff)
downloadtor-e6ba07f8f57f19cf82299fc61dac3435ec4d6e64.tar.gz
tor-e6ba07f8f57f19cf82299fc61dac3435ec4d6e64.zip
r13634@catbus: nickm | 2007-07-06 14:20:50 -0400
Fix a crash bug (*the* crash bug?) on authorities. Backport candidate. svn:r10752
-rw-r--r--ChangeLog4
-rw-r--r--src/or/routerlist.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 196474e731..991f2de7e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,10 @@ Changes in version 0.2.0.3-alpha - 2007-??-??
- 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]
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index f9efc3f301..f8216e7218 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2423,6 +2423,8 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
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_add_to_routerlist(routerinfo_t *router, const char **msg,
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. "