summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-08-24 08:12:25 +0000
committerRoger Dingledine <arma@torproject.org>2007-08-24 08:12:25 +0000
commit738ecba367af855ac6bafd0a80947a05dff32575 (patch)
tree5dd05d30fe3da68b430fa55f434b90b0c84eb277
parent9bacf68851b3803a84e76d532aeb3f72d35273fd (diff)
downloadtor-738ecba367af855ac6bafd0a80947a05dff32575.tar.gz
tor-738ecba367af855ac6bafd0a80947a05dff32575.zip
make the last patch do what i actually want. it was a bit tricky
since we want the default guardversion to be 0 (which is what it is if there's no guardversion line), yet when we're validating a freshly configed and defaulted state, we don't want to complain. svn:r11264
-rw-r--r--src/or/config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 39f4698d07..b8685193ad 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4357,7 +4357,7 @@ or_state_validate(or_state_t *old_state, or_state_t *state,
(void) from_setconf;
(void) old_state;
- if (state->GuardVersion < RECOMMENDED_GUARD_VERSION) {
+ if (state->EntryGuards && state->GuardVersion < RECOMMENDED_GUARD_VERSION) {
config_free_lines(state->EntryGuards);
state->EntryGuards = NULL;
log_notice(LD_CONFIG, "Detected state file from old version '%s'. "
@@ -4524,6 +4524,7 @@ or_state_save(time_t now)
len = strlen(get_version())+8;
global_state->TorVersion = tor_malloc(len);
tor_snprintf(global_state->TorVersion, len, "Tor %s", get_version());
+ global_state->GuardVersion = RECOMMENDED_GUARD_VERSION;
state = config_dump(&state_format, global_state, 1, 0);
len = strlen(state)+256;