diff options
author | David Goulet <dgoulet@ev0ke.net> | 2015-06-01 12:08:13 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-07-09 12:02:11 -0400 |
commit | 1125a4876b455d41b4c858cc97e8f8feef0fa8d0 (patch) | |
tree | e12fa2685ced7ff9b21b1abb586070277be75e5b /src/or/or.h | |
parent | 7c7bb8b97ed1fd012fd8cd4cf16217a1757621ec (diff) | |
download | tor-1125a4876b455d41b4c858cc97e8f8feef0fa8d0.tar.gz tor-1125a4876b455d41b4c858cc97e8f8feef0fa8d0.zip |
Reuse intro points that failed but are still valid
There is a case where if the introduction circuit fails but the node is
still in the consensus, we clean up the intro point and choose an other one.
This commit fixes that by trying to reuse the existing intro point with a
maximum value of retry.
A retry_nodes list is added to rend_services_introduce() and when we remove
an invalid intro points that fits the use case mentionned before, we add the
node to the retry list instead of removing it. Then, we retry on them before
creating new ones.
This means that the requirement to remove an intro point changes from "if no
intro circuit" to "if no intro circuit then if no node OR we've reached our
maximum circuit creation count".
For now, the maximum retries is set to 3 which it completely arbitrary. It
should also at some point be tied to the work done on detecting if our
network is down or not.
Fixes #8239
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index fc921a8e47..0deb4a79be 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -4881,6 +4881,11 @@ typedef struct rend_encoded_v2_service_descriptor_t { * XXX023 Should this be configurable? */ #define INTRO_POINT_LIFETIME_MAX_SECONDS (24*60*60) +/** The maximum number of circuit creation retry we do to an intro point + * before giving up. We try to reuse intro point that fails during their + * lifetime so this is a hard limit on the amount of time we do that. */ +#define MAX_INTRO_POINT_CIRCUIT_RETRIES 3 + /** Introduction point information. Used both in rend_service_t (on * the service side) and in rend_service_descriptor_t (on both the * client and service side). */ @@ -4930,6 +4935,13 @@ typedef struct rend_intro_point_t { * (start to) expire, or -1 if we haven't decided when this intro * point should expire. */ time_t time_to_expire; + + /** (Service side only) The amount of circuit creation we've made to this + * intro point. This is incremented every time we do a circuit relaunch on + * this object which is triggered when the circuit dies but the node is + * still in the consensus. After MAX_INTRO_POINT_CIRCUIT_RETRIES, we give + * up on it. */ + unsigned int circuit_retries; } rend_intro_point_t; #define REND_PROTOCOL_VERSION_BITMASK_WIDTH 16 |