summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-04-26 22:48:00 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-27 00:01:41 -0400
commitb8b557dcb2bf719976858589345f08fffbab13e3 (patch)
tree6f4a8150729621548ae3a607f315a6d4875b7ffe
parentf7a5bc16d689e8b919285c66cd0f07a6694bcc69 (diff)
downloadtor-b8b557dcb2bf719976858589345f08fffbab13e3.tar.gz
tor-b8b557dcb2bf719976858589345f08fffbab13e3.zip
better user-facing warnings for unexpected last hops
these still aren't perfect, but we won't know how to correct them until we start experiencing surprised users.
-rw-r--r--src/or/circuitbuild.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 6401e71dae..90572d57c8 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2878,7 +2878,6 @@ warn_if_last_router_excluded(origin_circuit_t *circ, const extend_info_t *exit)
or_options_t *options = get_options();
routerset_t *rs = options->ExcludeNodes;
const char *description;
- int domain = LD_CIRC;
uint8_t purpose = circ->_base.purpose;
if (circ->build_state->onehop_tunnel)
@@ -2914,7 +2913,6 @@ warn_if_last_router_excluded(origin_circuit_t *circ, const extend_info_t *exit)
case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED:
case CIRCUIT_PURPOSE_C_REND_JOINED:
description = "chosen rendezvous point";
- domain = LD_BUG;
break;
case CIRCUIT_PURPOSE_CONTROLLER:
rs = options->_ExcludeExitNodesUnion;
@@ -2924,18 +2922,24 @@ warn_if_last_router_excluded(origin_circuit_t *circ, const extend_info_t *exit)
if (routerset_contains_extendinfo(rs, exit)) {
/* We should never get here if StrictNodes is set to 1. */
- if (options->StrictNodes)
- log_warn(LD_BUG, "Using an excluded node with StrictNodes set. "
- "Please report the following log message to the "
- "developers.");
- log_fn(LOG_WARN, domain, "Using %s '%s' which is listed in "
- "ExcludeNodes%s, because no other options were available. To "
- "prevent this, set the StrictNodes configuration option."
- "(Circuit purpose is %d)",
- description,exit->nickname,
- rs==options->ExcludeNodes?"":" or ExcludeExitNodes",
- (int)purpose);
- circuit_log_path(LOG_WARN, domain, circ);
+ if (options->StrictNodes) {
+ log_warn(LD_BUG, "Using %s '%s' which is listed in ExcludeNodes%s, "
+ "even though StrictNodes is set. Please report. "
+ "(Circuit purpose: %s)",
+ description, exit->nickname,
+ rs==options->ExcludeNodes?"":" or ExcludeExitNodes",
+ circuit_purpose_to_string(purpose));
+ } else {
+ log_warn(LD_CIRC, "Using %s '%s' which is listed in "
+ "ExcludeNodes%s, because no better options were available. To "
+ "prevent this (and possibly break your Tor functionality), "
+ "set the StrictNodes configuration option. "
+ "(Circuit purpose: %s)",
+ description, exit->nickname,
+ rs==options->ExcludeNodes?"":" or ExcludeExitNodes",
+ circuit_purpose_to_string(purpose));
+ }
+ circuit_log_path(LOG_WARN, LD_CIRC, circ);
}
return;