diff options
author | Roger Dingledine <arma@torproject.org> | 2011-02-08 08:08:47 -0500 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2011-02-08 08:08:47 -0500 |
commit | 9a1a96ba0947e1c9b0e43aef6600b0d083586cf5 (patch) | |
tree | c936dfbd9b091e9ec6fa7c4a6b50957ed6cebdec /src/or/routerlist.c | |
parent | 54ccc80a4a740c175f279d00dc5441c673b0263c (diff) | |
download | tor-9a1a96ba0947e1c9b0e43aef6600b0d083586cf5.tar.gz tor-9a1a96ba0947e1c9b0e43aef6600b0d083586cf5.zip |
don't use old non-configured bridges (bug 2511)
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 6d6386292f..bbd08f39ef 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -3314,6 +3314,19 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg, return ROUTER_NOT_IN_CONSENSUS; } + /* If we're reading a bridge descriptor from our cache, and we don't + * recognize it as one of our currently configured bridges, drop the + * descriptor. Otherwise we could end up using it as one of our entry + * guards even if it isn't in our Bridge config lines. */ + if (router->purpose == ROUTER_PURPOSE_BRIDGE && from_cache && + !routerinfo_is_a_configured_bridge(router)) { + log_info(LD_DIR, "Dropping bridge descriptor for '%s' because we have " + "no bridge configured at that address.", router->nickname); + *msg = "Router descriptor was not a configured bridge."; + routerinfo_free(router); + return ROUTER_WAS_NOT_NEW; + } + /* If we have a router with the same identity key, choose the newer one. */ if (old_router) { if (!in_consensus && (router->cache_info.published_on <= |