aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_service.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-08-19 16:00:58 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2017-08-19 16:29:23 +0300
commit3e593f09addb210f1da39bd46f5fb904cac4e410 (patch)
tree2ed59125c449cc8535aac420f8ee6bdbdb49ff4e /src/or/hs_service.c
parent7823c98a38556237a86c7235d411d7d2237cc2d6 (diff)
downloadtor-3e593f09addb210f1da39bd46f5fb904cac4e410.tar.gz
tor-3e593f09addb210f1da39bd46f5fb904cac4e410.zip
prop224: Recompute all HSDir indices when we enter overlap mode.
When we enter overlap mode we start using the next hsdir index of relays. However, we only compute the next hsdir index of relays when we receive a consensus or their descriptor. This means that there is a window of time between entering the overlap period and fetching the consensus where relays have their next hsdir index uninitialized. This patch fixes this by recomputing all hsdir indices when we first enter the overlap period.
Diffstat (limited to 'src/or/hs_service.c')
-rw-r--r--src/or/hs_service.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index e213efe06a..31776c8b5e 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -1739,6 +1739,13 @@ rotate_all_descriptors(time_t now)
* it in order to make sure we don't rotate at next check. */
service->state.in_overlap_period = 1;
+ /* We just entered overlap period: recompute all HSDir indices. We need to
+ * do this otherwise nodes can get stuck with old HSDir indices until we
+ * fetch a new consensus, and we might need to reupload our desc before
+ * that. */
+ /* XXX find a better place than rotate_all_descriptors() to do this */
+ nodelist_recompute_all_hsdir_indices();
+
/* If we have a next descriptor lined up, rotate the descriptors so that it
* becomes current. */
if (service->desc_next) {