aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-07 13:11:06 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-07 13:11:06 -0500
commit90db39448db254d87228e4b7b34c61a4dce6a634 (patch)
treee00017416274282693e813e7eddf36cf434f181e /src/or
parent1abd526c75eade83318a6ec6aff84d5f0f079a3b (diff)
downloadtor-90db39448db254d87228e4b7b34c61a4dce6a634.tar.gz
tor-90db39448db254d87228e4b7b34c61a4dce6a634.zip
Downgrade warnings about extrainfo incompatibility when reading cache
Fixes 13762.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerlist.c10
-rw-r--r--src/or/routerlist.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 6cb052c03e..aab0aab379 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2752,7 +2752,7 @@ routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
* corresponding router in rl-\>routers or rl-\>old_routers. Return the status
* of inserting <b>ei</b>. Free <b>ei</b> if it isn't inserted. */
MOCK_IMPL(STATIC was_router_added_t,
-extrainfo_insert,(routerlist_t *rl, extrainfo_t *ei))
+extrainfo_insert,(routerlist_t *rl, extrainfo_t *ei, int warn_if_incompatible))
{
was_router_added_t r;
const char *compatibility_error_msg;
@@ -2774,11 +2774,13 @@ extrainfo_insert,(routerlist_t *rl, extrainfo_t *ei))
}
if (routerinfo_incompatible_with_extrainfo(ri, ei, sd,
&compatibility_error_msg)) {
+ const int severity = warn_if_incompatible ? LOG_WARN : LOG_INFO;
r = (ri->cache_info.extrainfo_is_bogus) ?
ROUTER_BAD_EI : ROUTER_NOT_IN_CONSENSUS;
- log_warn(LD_DIR,"router info incompatible with extra info (reason: %s)",
- compatibility_error_msg);
+ log_fn(severity,LD_DIR,
+ "router info incompatible with extra info (reason: %s)",
+ compatibility_error_msg);
goto done;
}
@@ -3324,7 +3326,7 @@ router_add_extrainfo_to_routerlist(extrainfo_t *ei, const char **msg,
if (msg) *msg = NULL;
/*XXXX023 Do something with msg */
- inserted = extrainfo_insert(router_get_routerlist(), ei);
+ inserted = extrainfo_insert(router_get_routerlist(), ei, !from_cache);
if (WRA_WAS_ADDED(inserted) && !from_cache)
signed_desc_append_to_journal(&ei->cache_info,
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index d7e15db87e..0d22543a27 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -227,7 +227,7 @@ STATIC void scale_array_elements_to_u64(u64_dbl_t *entries, int n_entries,
MOCK_DECL(int, router_descriptor_is_older_than, (const routerinfo_t *router,
int seconds));
MOCK_DECL(STATIC was_router_added_t, extrainfo_insert,
- (routerlist_t *rl, extrainfo_t *ei));
+ (routerlist_t *rl, extrainfo_t *ei, int warn_if_incompatible));
#endif