diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-07 13:11:06 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-07 13:11:06 -0500 |
commit | 90db39448db254d87228e4b7b34c61a4dce6a634 (patch) | |
tree | e00017416274282693e813e7eddf36cf434f181e /src | |
parent | 1abd526c75eade83318a6ec6aff84d5f0f079a3b (diff) | |
download | tor-90db39448db254d87228e4b7b34c61a4dce6a634.tar.gz tor-90db39448db254d87228e4b7b34c61a4dce6a634.zip |
Downgrade warnings about extrainfo incompatibility when reading cache
Fixes 13762.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerlist.c | 10 | ||||
-rw-r--r-- | src/or/routerlist.h | 2 | ||||
-rw-r--r-- | src/test/test_dir.c | 3 |
3 files changed, 9 insertions, 6 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 diff --git a/src/test/test_dir.c b/src/test/test_dir.c index c6594f8359..a8c6c6fad4 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -714,9 +714,10 @@ mock_get_by_ei_desc_digest(const char *d) static smartlist_t *mock_ei_insert_list = NULL; static was_router_added_t -mock_ei_insert(routerlist_t *rl, extrainfo_t *ei) +mock_ei_insert(routerlist_t *rl, extrainfo_t *ei, int warn_if_incompatible) { (void) rl; + (void) warn_if_incompatible; smartlist_add(mock_ei_insert_list, ei); return ROUTER_ADDED_SUCCESSFULLY; } |