summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-27 14:36:30 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-27 14:36:30 -0400
commit8b686d98c47226dfc4d7c87d6a472b592135ae07 (patch)
tree06df10f204230dc1be42abec946430b8d20f084f /src/or/router.c
parent3256627a4548c4977b834cc724689e0e9a960f06 (diff)
parent99621bc5a629a81a5a823ce21ac3d967443d0e12 (diff)
downloadtor-8b686d98c47226dfc4d7c87d6a472b592135ae07.tar.gz
tor-8b686d98c47226dfc4d7c87d6a472b592135ae07.zip
Merge maint-0.2.2 for the bug1090-part1-squashed branch
Resolved conflicts in: doc/tor.1.txt src/or/circuitbuild.c src/or/circuituse.c src/or/connection_edge.c src/or/connection_edge.h src/or/directory.c src/or/rendclient.c src/or/routerlist.c src/or/routerlist.h These were mostly releated to the routerinfo_t->node_t conversion.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index eb4d6b5d40..8edbb47058 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -852,9 +852,29 @@ consider_testing_reachability(int test_or, int test_dir)
const routerinfo_t *me = router_get_my_routerinfo();
int orport_reachable = check_whether_orport_reachable();
tor_addr_t addr;
+ or_options_t *options = get_options();
if (!me)
return;
+ if (routerset_contains_router(options->ExcludeNodes, me, -1) &&
+ options->StrictNodes) {
+ /* If we've excluded ourself, and StrictNodes is set, we can't test
+ * ourself. */
+ if (test_or || test_dir) {
+#define SELF_EXCLUDED_WARN_INTERVAL 3600
+ static ratelim_t warning_limit=RATELIM_INIT(SELF_EXCLUDED_WARN_INTERVAL);
+ char *msg;
+ if ((msg = rate_limit_log(&warning_limit, approx_time()))) {
+ log_warn(LD_CIRC, "Can't peform self-tests for this relay: we have "
+ "listed ourself in ExcludeNodes, and StrictNodes is set. "
+ "We cannot learn whether we are usable, and will not "
+ "be able to advertise ourself.%s", msg);
+ tor_free(msg);
+ }
+ }
+ return;
+ }
+
if (test_or && (!orport_reachable || !circuit_enough_testing_circs())) {
extend_info_t *ei;
log_info(LD_CIRC, "Testing %s of my ORPort: %s:%d.",