diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-23 08:55:31 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-23 08:55:31 -0500 |
commit | b677ccd3aba80f4b66f16e6e1c0e3c68b49106c5 (patch) | |
tree | a0c975bae9f4dacde438e1f57db9f4a145f93cd7 /src/or | |
parent | d8517fe8435dbe9e4593d04fa8ec4db464513892 (diff) | |
parent | 90db39448db254d87228e4b7b34c61a4dce6a634 (diff) | |
download | tor-b677ccd3aba80f4b66f16e6e1c0e3c68b49106c5.tar.gz tor-b677ccd3aba80f4b66f16e6e1c0e3c68b49106c5.zip |
Merge remote-tracking branch 'public/ticket13762'
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/routerlist.c | 10 | ||||
-rw-r--r-- | src/or/routerlist.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index d3734238eb..b5e58a4623 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2753,7 +2753,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; @@ -2775,11 +2775,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; } @@ -3325,7 +3327,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 |