mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Bug 6475: Demote pathbias log messages for 0.2.3.x
Also make a couple of them less scary. We'll do a separate, additional commit on 0.2.4.x to bump them back up again.
This commit is contained in:
+16
-9
@@ -2657,7 +2657,7 @@ pathbias_count_first_hop(origin_circuit_t *circ)
|
||||
if (circ->has_opened && circ->path_state != PATH_STATE_DID_FIRST_HOP) {
|
||||
if ((rate_msg = rate_limit_log(&first_hop_notice_limit,
|
||||
approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"Opened circuit is in strange path state %s. "
|
||||
"Circuit is a %s currently %s. %s",
|
||||
pathbias_state_to_string(circ->path_state),
|
||||
@@ -2684,7 +2684,7 @@ pathbias_count_first_hop(origin_circuit_t *circ)
|
||||
} else {
|
||||
if ((rate_msg = rate_limit_log(&first_hop_notice_limit,
|
||||
approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"Unopened circuit has strange path state %s. "
|
||||
"Circuit is a %s currently %s. %s",
|
||||
pathbias_state_to_string(circ->path_state),
|
||||
@@ -2696,7 +2696,7 @@ pathbias_count_first_hop(origin_circuit_t *circ)
|
||||
} else {
|
||||
if ((rate_msg = rate_limit_log(&first_hop_notice_limit,
|
||||
approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"Unopened circuit has no known guard. "
|
||||
"Circuit is a %s currently %s. %s",
|
||||
circuit_purpose_to_string(circ->_base.purpose),
|
||||
@@ -2710,7 +2710,7 @@ pathbias_count_first_hop(origin_circuit_t *circ)
|
||||
if (circ->path_state == PATH_STATE_NEW_CIRC) {
|
||||
if ((rate_msg = rate_limit_log(&first_hop_notice_limit,
|
||||
approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"A %s circuit is in cpath state %d (opened: %d). "
|
||||
"Circuit is a %s currently %s. %s",
|
||||
pathbias_state_to_string(circ->path_state),
|
||||
@@ -2770,7 +2770,7 @@ pathbias_count_success(origin_circuit_t *circ)
|
||||
} else {
|
||||
if ((rate_msg = rate_limit_log(&success_notice_limit,
|
||||
approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"Succeeded circuit is in strange path state %s. "
|
||||
"Circuit is a %s currently %s. %s",
|
||||
pathbias_state_to_string(circ->path_state),
|
||||
@@ -2781,7 +2781,7 @@ pathbias_count_success(origin_circuit_t *circ)
|
||||
}
|
||||
|
||||
if (guard->first_hops < guard->circuit_successes) {
|
||||
log_warn(LD_BUG, "Unexpectedly high circuit_successes (%u/%u) "
|
||||
log_notice(LD_BUG, "Unexpectedly high circuit_successes (%u/%u) "
|
||||
"for guard %s=%s",
|
||||
guard->circuit_successes, guard->first_hops,
|
||||
guard->nickname, hex_str(guard->identity, DIGEST_LEN));
|
||||
@@ -2792,7 +2792,7 @@ pathbias_count_success(origin_circuit_t *circ)
|
||||
} else if (circ->_base.purpose != CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT) {
|
||||
if ((rate_msg = rate_limit_log(&success_notice_limit,
|
||||
approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"Completed circuit has no known guard. "
|
||||
"Circuit is a %s currently %s. %s",
|
||||
circuit_purpose_to_string(circ->_base.purpose),
|
||||
@@ -2804,7 +2804,7 @@ pathbias_count_success(origin_circuit_t *circ)
|
||||
if (circ->path_state != PATH_STATE_SUCCEEDED) {
|
||||
if ((rate_msg = rate_limit_log(&success_notice_limit,
|
||||
approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"Opened circuit is in strange path state %s. "
|
||||
"Circuit is a %s currently %s. %s",
|
||||
pathbias_state_to_string(circ->path_state),
|
||||
@@ -2834,9 +2834,11 @@ entry_guard_inc_first_hop_count(entry_guard_t *guard)
|
||||
if (guard->circuit_successes/((double)guard->first_hops)
|
||||
< pathbias_get_disable_rate(options)) {
|
||||
|
||||
/* This message is currently disabled by default. */
|
||||
log_warn(LD_PROTOCOL,
|
||||
"Extremely low circuit success rate %u/%u for guard %s=%s. "
|
||||
"This might indicate an attack, or a bug.",
|
||||
"This indicates either an overloaded guard, an attack, or "
|
||||
"a bug.",
|
||||
guard->circuit_successes, guard->first_hops, guard->nickname,
|
||||
hex_str(guard->identity, DIGEST_LEN));
|
||||
|
||||
@@ -2857,6 +2859,11 @@ entry_guard_inc_first_hop_count(entry_guard_t *guard)
|
||||
/* If we get a ton of circuits, just scale everything down */
|
||||
if (guard->first_hops > (unsigned)pathbias_get_scale_threshold(options)) {
|
||||
const int scale_factor = pathbias_get_scale_factor(options);
|
||||
log_info(LD_PROTOCOL,
|
||||
"Scaling pathbias counts to (%u/%u)/%d for guard %s=%s",
|
||||
guard->circuit_successes, guard->first_hops,
|
||||
scale_factor, guard->nickname, hex_str(guard->identity,
|
||||
DIGEST_LEN));
|
||||
guard->first_hops /= scale_factor;
|
||||
guard->circuit_successes /= scale_factor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user