diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-23 10:04:23 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:15 -0500 |
commit | ac67819396ac9e96c3dd65a5b5b23715e11eeec5 (patch) | |
tree | 5a3611b18c2c093e6c054a369e219c6dbb8816f0 /src/or/entrynodes.h | |
parent | f71be7434074a1b7f8508b96cbf55cee44afb993 (diff) | |
download | tor-ac67819396ac9e96c3dd65a5b5b23715e11eeec5.tar.gz tor-ac67819396ac9e96c3dd65a5b5b23715e11eeec5.zip |
Make sure primary-guards are up-to-date when we inspect them.
(Plus some magic to prevent and detect recursive invocation of
entry_guards_update_primary(), since that can cause some pretty
tricky misbehavior.)
Diffstat (limited to 'src/or/entrynodes.h')
-rw-r--r-- | src/or/entrynodes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h index 4cbfbf55bf..a514c13a8e 100644 --- a/src/or/entrynodes.h +++ b/src/or/entrynodes.h @@ -223,6 +223,13 @@ struct guard_selection_s { int dirty; /** + * A value of 1 means that primary_entry_guards is up-to-date; 0 + * means we need to recalculate it before using primary_entry_guards + * or the is_primary flag on any guard. + */ + int primary_guards_up_to_date; + + /** * A list of the sampled entry guards, as entry_guard_t structures. * Not in any particular order. When we 'sample' a guard, we are * noting it as a possible guard to pick in the future. The use of @@ -428,6 +435,7 @@ STATIC void entry_guards_update_filtered_sets(guard_selection_t *gs); #define SAMPLE_EXCLUDE_CONFIRMED (1u<<0) #define SAMPLE_EXCLUDE_PRIMARY (1u<<1) #define SAMPLE_EXCLUDE_PENDING (1u<<2) +#define SAMPLE_NO_UPDATE_PRIMARY (1u<<3) /**@}*/ STATIC entry_guard_t *sample_reachable_filtered_entry_guards( guard_selection_t *gs, |