aboutsummaryrefslogtreecommitdiff
path: root/src/or/entrynodes.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-08 10:02:19 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-16 11:06:22 -0500
commit2e2f3a4d99885c0d348024dc85ed6ef064a62ace (patch)
tree2f0b6154a5e0ec5a545ff7d79c04c61b7d131dce /src/or/entrynodes.h
parente50d85b90cb3fbc562517c11ded12940682ffec0 (diff)
downloadtor-2e2f3a4d99885c0d348024dc85ed6ef064a62ace.tar.gz
tor-2e2f3a4d99885c0d348024dc85ed6ef064a62ace.zip
Add a separate, non-fractional, limit to the sampled guard set size.
Letting the maximum sample size grow proportionally to the number of guards defeats its purpose to a certain extent. Noted by asn during code review. Fixes bug 20920; bug not in any released (or merged) version of Tor.
Diffstat (limited to 'src/or/entrynodes.h')
-rw-r--r--src/or/entrynodes.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h
index 11335255e2..d7dc01424a 100644
--- a/src/or/entrynodes.h
+++ b/src/or/entrynodes.h
@@ -440,7 +440,12 @@ int num_bridges_usable(void);
* We never let our sampled guard set grow larger than this percentage
* of the guards on the network.
*/
-#define DFLT_MAX_SAMPLE_THRESHOLD_PERCENT 30
+#define DFLT_MAX_SAMPLE_THRESHOLD_PERCENT 20
+/**
+ * We never let our sampled guard set grow larger than this number of
+ * guards.
+ */
+#define DFLT_MAX_SAMPLE_SIZE 60
/**
* We always try to make our sample contain at least this many guards.
*
@@ -495,6 +500,7 @@ int num_bridges_usable(void);
/**@}*/
STATIC double get_max_sample_threshold(void);
+STATIC int get_max_sample_size_absolute(void);
STATIC int get_min_filtered_sample_size(void);
STATIC int get_remove_unlisted_guards_after_days(void);
STATIC int get_guard_lifetime_days(void);