Skip to content
Snippets Groups Projects
Commit 72b89c96 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

fix two issues pointed out by nickm

parent 9a1a96ba
No related branches found
No related tags found
No related merge requests found
...@@ -3499,6 +3499,7 @@ typedef enum was_router_added_t { ...@@ -3499,6 +3499,7 @@ typedef enum was_router_added_t {
ROUTER_NOT_IN_CONSENSUS = -3, ROUTER_NOT_IN_CONSENSUS = -3,
ROUTER_NOT_IN_CONSENSUS_OR_NETWORKSTATUS = -4, ROUTER_NOT_IN_CONSENSUS_OR_NETWORKSTATUS = -4,
ROUTER_AUTHDIR_REJECTS = -5, ROUTER_AUTHDIR_REJECTS = -5,
ROUTER_WAS_NOT_WANTED = -6
} was_router_added_t; } was_router_added_t;
/********************************* routerparse.c ************************/ /********************************* routerparse.c ************************/
......
...@@ -3209,7 +3209,8 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg, ...@@ -3209,7 +3209,8 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
int from_cache, int from_fetch) int from_cache, int from_fetch)
{ {
const char *id_digest; const char *id_digest;
int authdir = authdir_mode_handles_descs(get_options(), router->purpose); or_options_t *options = get_options();
int authdir = authdir_mode_handles_descs(options, router->purpose);
int authdir_believes_valid = 0; int authdir_believes_valid = 0;
routerinfo_t *old_router; routerinfo_t *old_router;
networkstatus_t *consensus = networkstatus_get_latest_consensus(); networkstatus_t *consensus = networkstatus_get_latest_consensus();
...@@ -3319,12 +3320,13 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg, ...@@ -3319,12 +3320,13 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
* descriptor. Otherwise we could end up using it as one of our entry * descriptor. Otherwise we could end up using it as one of our entry
* guards even if it isn't in our Bridge config lines. */ * guards even if it isn't in our Bridge config lines. */
if (router->purpose == ROUTER_PURPOSE_BRIDGE && from_cache && if (router->purpose == ROUTER_PURPOSE_BRIDGE && from_cache &&
!authdir_mode_bridge(options) &&
!routerinfo_is_a_configured_bridge(router)) { !routerinfo_is_a_configured_bridge(router)) {
log_info(LD_DIR, "Dropping bridge descriptor for '%s' because we have " log_info(LD_DIR, "Dropping bridge descriptor for '%s' because we have "
"no bridge configured at that address.", router->nickname); "no bridge configured at that address.", router->nickname);
*msg = "Router descriptor was not a configured bridge."; *msg = "Router descriptor was not a configured bridge.";
routerinfo_free(router); routerinfo_free(router);
return ROUTER_WAS_NOT_NEW; return ROUTER_WAS_NOT_WANTED;
} }
/* If we have a router with the same identity key, choose the newer one. */ /* If we have a router with the same identity key, choose the newer one. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment