summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-01-12 03:43:39 +0000
committerRoger Dingledine <arma@torproject.org>2006-01-12 03:43:39 +0000
commit0e51d5d274933e9e2ebd963a2fcf18890cbd41d7 (patch)
treee3d37434657b3f9e51ce7a47eb59b8489fc47e3e
parent38d32bc46620c990d0f099da6138c4d4c6b0118e (diff)
downloadtor-0e51d5d274933e9e2ebd963a2fcf18890cbd41d7.tar.gz
tor-0e51d5d274933e9e2ebd963a2fcf18890cbd41d7.zip
When the controller was submitting a descriptor, we were checking to make
sure some network-status we had referred to it, and refusing it if not. This is bad for people who want to insert descriptors that aren't part of the current Tor network. Now we accept them, and also give a more useful warn message if we ask a dir mirror for a given descriptor and it gives us one we weren't expecting. svn:r5824
-rw-r--r--src/or/routerlist.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 0513495237..d9d636e707 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1523,23 +1523,27 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
if (authdir) {
if (authdir_wants_to_reject_router(router, msg,
!from_cache && !from_fetch)) {
+ tor_assert(*msg);
routerinfo_free(router);
return -2;
}
authdir_verified = router->is_verified;
- } else if (!from_cache) {
+ } else if (from_fetch) {
/* Only check the descriptor digest against the network statuses when
- * we are receiving from somewhere other than the cache. */
+ * we are receiving in response to a fetch. */
if (!signed_desc_digest_is_recognized(&router->cache_info)) {
warn(LD_DIR, "Dropping unrecognized descriptor for router '%s'",
router->nickname);
+ *msg = "Router descriptor is not referenced by any network-status.";
routerinfo_free(router);
return -1;
}
}
/* If we have a router with this name, and the identity key is the same,
- * choose the newer one. If the identity key has changed, drop the router.
+ * choose the newer one. If the identity key has changed, and one of the
+ * routers is named, drop the unnamed ones. (If more than one are named,
+ * drop the old ones.)
*/
for (i = 0; i < smartlist_len(routerlist->routers); ++i) {
routerinfo_t *old_router = smartlist_get(routerlist->routers, i);