From 914bfe765d72627fddc4bdda3fbd7f77008aca26 Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Tue, 26 Mar 2013 18:49:41 -0700 Subject: [PATCH 1/2] Bug 7065: Use $ for idhex instead of = --- src/or/circuitbuild.c | 28 ++++++++++++++-------------- src/or/routerparse.c | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 8e768e76f5..ce552b47f4 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1539,7 +1539,7 @@ pathbias_count_build_success(origin_circuit_t *circ) guard->circ_successes++; entry_guards_changed(); - log_info(LD_CIRC, "Got success count %f/%f for guard %s=%s", + log_info(LD_CIRC, "Got success count %f/%f for guard %s ($%s)", guard->circ_successes, guard->circ_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); } else { @@ -1558,7 +1558,7 @@ pathbias_count_build_success(origin_circuit_t *circ) if (guard->circ_attempts < guard->circ_successes) { log_notice(LD_BUG, "Unexpectedly high successes counts (%f/%f) " - "for guard %s=%s", + "for guard %s ($%s)", guard->circ_successes, guard->circ_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); } @@ -1626,7 +1626,7 @@ pathbias_count_use_attempt(origin_circuit_t *circ) entry_guards_changed(); log_debug(LD_CIRC, - "Marked circuit %d (%f/%f) as used for guard %s=%s.", + "Marked circuit %d (%f/%f) as used for guard %s ($%s).", circ->global_identifier, guard->use_successes, guard->use_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); @@ -1736,7 +1736,7 @@ pathbias_count_use_success(origin_circuit_t *circ) log_debug(LD_CIRC, "Marked circuit %d (%f/%f) as used successfully for guard " - "%s=%s.", + "%s ($%s).", circ->global_identifier, guard->use_successes, guard->use_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); @@ -2253,7 +2253,7 @@ pathbias_measure_use_rate(entry_guard_t *guard) if (pathbias_get_dropguards(options)) { if (!guard->path_bias_disabled) { log_warn(LD_CIRC, - "Your Guard %s=%s is failing to carry an extremely large " + "Your Guard %s ($%s) is failing to carry an extremely large " "amount of stream on its circuits. " "To avoid potential route manipulation attacks, Tor has " "disabled use of this guard. " @@ -2279,7 +2279,7 @@ pathbias_measure_use_rate(entry_guard_t *guard) } else if (!guard->path_bias_use_extreme) { guard->path_bias_use_extreme = 1; log_warn(LD_CIRC, - "Your Guard %s=%s is failing to carry an extremely large " + "Your Guard %s ($%s) is failing to carry an extremely large " "amount of streams on its circuits. " "This could indicate a route manipulation attack, network " "overload, bad local network connectivity, or a bug. " @@ -2303,7 +2303,7 @@ pathbias_measure_use_rate(entry_guard_t *guard) if (!guard->path_bias_use_noticed) { guard->path_bias_use_noticed = 1; log_notice(LD_CIRC, - "Your Guard %s=%s is failing to carry more streams on its " + "Your Guard %s ($%s) is failing to carry more streams on its " "circuits than usual. " "Most likely this means the Tor network is overloaded " "or your network connection is poor. " @@ -2359,7 +2359,7 @@ pathbias_measure_close_rate(entry_guard_t *guard) if (pathbias_get_dropguards(options)) { if (!guard->path_bias_disabled) { log_warn(LD_CIRC, - "Your Guard %s=%s is failing an extremely large " + "Your Guard %s ($%s) is failing an extremely large " "amount of circuits. " "To avoid potential route manipulation attacks, Tor has " "disabled use of this guard. " @@ -2385,7 +2385,7 @@ pathbias_measure_close_rate(entry_guard_t *guard) } else if (!guard->path_bias_extreme) { guard->path_bias_extreme = 1; log_warn(LD_CIRC, - "Your Guard %s=%s is failing an extremely large " + "Your Guard %s ($%s) is failing an extremely large " "amount of circuits. " "This could indicate a route manipulation attack, " "extreme network overload, or a bug. " @@ -2409,7 +2409,7 @@ pathbias_measure_close_rate(entry_guard_t *guard) if (!guard->path_bias_warned) { guard->path_bias_warned = 1; log_warn(LD_CIRC, - "Your Guard %s=%s is failing a very large " + "Your Guard %s ($%s) is failing a very large " "amount of circuits. " "Most likely this means the Tor network is " "overloaded, but it could also mean an attack against " @@ -2434,7 +2434,7 @@ pathbias_measure_close_rate(entry_guard_t *guard) if (!guard->path_bias_noticed) { guard->path_bias_noticed = 1; log_notice(LD_CIRC, - "Your Guard %s=%s is failing more circuits than " + "Your Guard %s ($%s) is failing more circuits than " "usual. " "Most likely this means the Tor network is overloaded. " "Success counts are %ld/%ld. Use counts are %ld/%ld. " @@ -2495,7 +2495,7 @@ pathbias_scale_close_rates(entry_guard_t *guard) log_info(LD_CIRC, "Scaled pathbias counts to (%f,%f)/%f (%d/%d open) for guard " - "%s=%s", + "%s ($%s)", guard->circ_successes, guard->successful_circuits_closed, guard->circ_attempts, opened_built, opened_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); @@ -2529,7 +2529,7 @@ pathbias_scale_use_rates(entry_guard_t *guard) guard->use_attempts += opened_attempts; log_info(LD_CIRC, - "Scaled pathbias use counts to %f/%f (%d open) for guard %s=%s", + "Scaled pathbias use counts to %f/%f (%d open) for guard %s ($%s)", guard->use_successes, guard->use_attempts, opened_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); entry_guards_changed(); @@ -2554,7 +2554,7 @@ entry_guard_inc_circ_attempt_count(entry_guard_t *guard) pathbias_scale_close_rates(guard); guard->circ_attempts++; - log_info(LD_CIRC, "Got success count %f/%f for guard %s=%s", + log_info(LD_CIRC, "Got success count %f/%f for guard %s ($%s)", guard->circ_successes, guard->circ_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); return 0; diff --git a/src/or/routerparse.c b/src/or/routerparse.c index b86864b5ee..a2b4f9e0fa 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -2030,7 +2030,7 @@ routerstatus_parse_entry_from_string(memarea_t *area, } } else { log_info(LD_BUG, "Found an entry in networkstatus with no " - "microdescriptor digest. (Router %s=%s at %s:%d.)", + "microdescriptor digest. (Router %s ($%s) at %s:%d.)", rs->nickname, hex_str(rs->identity_digest, DIGEST_LEN), fmt_addr32(rs->addr), rs->or_port); } From 4cc7cc28f8040b3a8f3faaca82abe27bbec0b744 Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Tue, 26 Mar 2013 18:55:12 -0700 Subject: [PATCH 2/2] Changes file for #7065 (revised by nickm) --- changes/bug7065 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/bug7065 diff --git a/changes/bug7065 b/changes/bug7065 new file mode 100644 index 0000000000..1ca6841021 --- /dev/null +++ b/changes/bug7065 @@ -0,0 +1,5 @@ + o Minor bugfix (log cleanups): + - Eliminate several instances where we use Nickname=ID to refer to + nodes in logs. Use Nickname (ID) instead. (Elsewhere, we still use + $ID=Nickname, which is also acceptable.) Fixes bug #7065. Bugfix + on 0.2.3.21-rc, 0.2.4.5-alpha, 0.2.4.8-alpha, and 0.2.4.10-alpha.