From af0e8d834e4b1da029f7505745225f848e96def6 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sat, 21 May 2011 19:23:27 -0400 Subject: [PATCH 1/2] don't mark our descriptor dirty if our onion key hasn't changed --- changes/bug3263 | 4 ++++ src/or/router.c | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 changes/bug3263 diff --git a/changes/bug3263 b/changes/bug3263 new file mode 100644 index 0000000000..43202c276f --- /dev/null +++ b/changes/bug3263 @@ -0,0 +1,4 @@ + o Minor bugfixes: + - Don't publish a new relay descriptor when we reload our onion key, + unless the onion key has actually changed. Fixes bug 3263 and + resolves another cause of bug 1810. Bugfix on 0.1.1.11-alpha. diff --git a/src/or/router.c b/src/or/router.c index 184715b750..f6728aac91 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -82,6 +82,11 @@ static authority_cert_t *legacy_key_certificate = NULL; static void set_onion_key(crypto_pk_env_t *k) { + if (onionkey && !crypto_pk_cmp_keys(onionkey, k)) { + /* k is already our onion key; free it and return */ + crypto_free_pk_env(k); + return; + } tor_mutex_acquire(key_lock); crypto_free_pk_env(onionkey); onionkey = k; From bc3c54a07f035c69b81cbf7817b8071938abf2ca Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 7 Jul 2011 11:05:06 -0400 Subject: [PATCH 2/2] Have transitions in public_server_mode count as affects_descriptor Previously, we'd get a new descriptor for free when public_server_mode() changed, since it would count as affects_workers, which would call init_keys(), which would make us regenerate a new descriptor. But now that we fixed bug 3263, init_keys() is no longer necessarily a new descriptor, and so we need to make sure that public_server_mode() counts as a descriptor transition. --- src/or/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/or/config.c b/src/or/config.c index 36fb991e33..4bdb0384d9 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3847,7 +3847,8 @@ options_transition_affects_descriptor(or_options_t *old_options, !opt_streq(old_options->ContactInfo, new_options->ContactInfo) || !opt_streq(old_options->MyFamily, new_options->MyFamily) || !opt_streq(old_options->AccountingStart, new_options->AccountingStart) || - old_options->AccountingMax != new_options->AccountingMax) + old_options->AccountingMax != new_options->AccountingMax || + public_server_mode(old_options) != public_server_mode(new_options)) return 1; return 0;