summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-04-24 11:18:41 -0400
committerNick Mathewson <nickm@torproject.org>2012-04-24 11:18:41 -0400
commit461771ebbce3a86965eb2d696f9d42e9bcb777c9 (patch)
tree4b4ced672b7e6a80aa2d2a8e7df8430a1a40e04e /src/or/router.c
parent6f5a74002ac6406ebe602a3d8d36d251bd217df4 (diff)
parentdb81cdbb0f9a69bc7bb0a4f77ff0fe44875f7cda (diff)
downloadtor-461771ebbce3a86965eb2d696f9d42e9bcb777c9.tar.gz
tor-461771ebbce3a86965eb2d696f9d42e9bcb777c9.zip
Merge branch 'bug4438-v2'
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/or/router.c b/src/or/router.c
index eb201f4bc9..4cdfd02e56 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -651,15 +651,27 @@ init_keys(void)
return -1;
}
if (mydesc) {
+ was_router_added_t added;
ri = router_parse_entry_from_string(mydesc, NULL, 1, 0, NULL);
if (!ri) {
log_err(LD_GENERAL,"Generated a routerinfo we couldn't parse.");
return -1;
}
- if (!WRA_WAS_ADDED(dirserv_add_descriptor(ri, &m, "self"))) {
- log_err(LD_GENERAL,"Unable to add own descriptor to directory: %s",
- m?m:"<unknown error>");
- return -1;
+ added = dirserv_add_descriptor(ri, &m, "self");
+ if (!WRA_WAS_ADDED(added)) {
+ if (!WRA_WAS_OUTDATED(added)) {
+ log_err(LD_GENERAL, "Unable to add own descriptor to directory: %s",
+ m?m:"<unknown error>");
+ return -1;
+ } else {
+ /* If the descriptor was outdated, that's ok. This can happen
+ * when some config options are toggled that affect workers, but
+ * we don't really need new keys yet so the descriptor doesn't
+ * change and the old one is still fresh. */
+ log_info(LD_GENERAL, "Couldn't add own descriptor to directory "
+ "after key init: %s. This is usually not a problem.",
+ m?m:"<unknown error>");
+ }
}
}
}