diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-08-29 17:22:00 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-08-29 17:22:00 +0000 |
commit | 4266039c195ebf5ed38d02fbe31770fb6a03e254 (patch) | |
tree | 20f6ecfacdea173c8827552a6ec49b9c937279df /src/or/config.c | |
parent | 1050eceb2ffc23a2780795fd23f87776a9f26c23 (diff) | |
download | tor-4266039c195ebf5ed38d02fbe31770fb6a03e254.tar.gz tor-4266039c195ebf5ed38d02fbe31770fb6a03e254.zip |
r14826@catbus: nickm | 2007-08-29 13:19:55 -0400
Add a line to the state file for each guard to let us know which version added the guard. If the line is absent, assume the guard was added by whatever version of Tor last wrote the state file. Remove guards if the version that added them was using a bad guard selection algorithm. (Previously, we removed guards if the version that wrote the file was using a bad guard selection algorithm, even if the guards themselves were chosen by a good version.)
svn:r11298
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/or/config.c b/src/or/config.c index 6285fe4aec..735d214327 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -302,6 +302,7 @@ static config_var_t _state_vars[] = { VAR("EntryGuard", LINELIST_S, EntryGuards, NULL), VAR("EntryGuardDownSince", LINELIST_S, EntryGuards, NULL), VAR("EntryGuardUnlistedSince", LINELIST_S, EntryGuards, NULL), + VAR("EntryGuardAddedBy", LINELIST_S, EntryGuards, NULL), V(EntryGuards, LINELIST_V, NULL), V(BWHistoryReadEnds, ISOTIME, NULL), @@ -4355,24 +4356,6 @@ or_state_validate(or_state_t *old_state, or_state_t *state, if (entry_guards_parse_state(state, 0, msg)<0) return -1; - if (state->EntryGuards && 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.2.16-dev")) || - (tor_version_as_new_as(state->TorVersion, "0.2.0.0-alpha") && - !tor_version_as_new_as(state->TorVersion, "0.2.0.6-alpha"))) { - log_notice(LD_CONFIG, "Detected state file from old version '%s'. " - "Choosing new entry guards for you.", - state->TorVersion); - config_free_lines(state->EntryGuards); - state->EntryGuards = NULL; - } - } - } return 0; } |