mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
when upgrading to newer versions, throw away entry guards
picked by the old wrong algorithms. svn:r6215
This commit is contained in:
parent
8a8a84dd52
commit
f11509e494
@ -4018,14 +4018,25 @@ static int
|
||||
or_state_validate(or_state_t *old_state, or_state_t *state, int from_setconf)
|
||||
{
|
||||
const char *err;
|
||||
tor_version_t v;
|
||||
|
||||
if (entry_guards_parse_state(state, 0, &err)<0) {
|
||||
log_warn(LD_GENERAL, "Unable to parse entry nodes: %s", err);
|
||||
return -1;
|
||||
}
|
||||
if (state->TorVersion && tor_version_parse(state->TorVersion, &v)) {
|
||||
log_warn(LD_GENERAL, "Can't parse Tor version '%s' from your state file. "
|
||||
"Proceeding anyway.", state->TorVersion);
|
||||
if (state->TorVersion) {
|
||||
tor_version_t v;
|
||||
if (tor_version_parse(state->TorVersion, &v)) {
|
||||
log_warn(LD_GENERAL, "Can't parse Tor version '%s' from your state file. "
|
||||
"Proceeding anyway.", state->TorVersion);
|
||||
} else { /* take action based on v */
|
||||
if (tor_version_as_new_as(state->TorVersion, "0.1.1.10-alpha") &&
|
||||
!tor_version_as_new_as(state->TorVersion, "0.1.1.16-rc-cvs")) {
|
||||
log_notice(LD_CONFIG, "Detected state file from buggy version '%s'. "
|
||||
"Enabling workaround to choose working entry guards.",
|
||||
state->TorVersion);
|
||||
config_free_lines(state->EntryGuards);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -4040,7 +4051,7 @@ or_state_set(or_state_t *new_state)
|
||||
config_free(&state_format, global_state);
|
||||
global_state = new_state;
|
||||
if (entry_guards_parse_state(global_state, 1, &err)<0)
|
||||
log_warn(LD_GENERAL,"Unparseable helper nodes state: %s",err);
|
||||
log_warn(LD_GENERAL,"Unparseable guard nodes state: %s",err);
|
||||
if (rep_hist_load_state(global_state, &err)<0)
|
||||
log_warn(LD_GENERAL,"Unparseable bandwidth history state: %s",err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user