aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-07 11:08:03 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-07 11:08:03 -0400
commit6b670d6032b33f255f88e31a727b8f042b1dfcef (patch)
tree290fa726b1ce5c3c333230073b5f964fc9f7e887 /src
parent586d0abe591e241124790b6ee0d273158e96bd0c (diff)
parentbc3c54a07f035c69b81cbf7817b8071938abf2ca (diff)
downloadtor-6b670d6032b33f255f88e31a727b8f042b1dfcef.tar
tor-6b670d6032b33f255f88e31a727b8f042b1dfcef.tar.gz
Merge branch 'bug3263'
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c3
-rw-r--r--src/or/router.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index bb335dd5f..4aabe6b95 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3980,7 +3980,8 @@ options_transition_affects_descriptor(const 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;
diff --git a/src/or/router.c b/src/or/router.c
index 60ee93a52..eaad57bb9 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -84,6 +84,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;