]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Provide consensus params to constrain the threshold for Fast
authorNick Mathewson <nickm@torproject.org>
Fri, 13 Jan 2012 17:05:08 +0000 (12:05 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 16 Jan 2012 19:50:13 +0000 (14:50 -0500)
resolves ticket 3946

changes/fast_bw_param [new file with mode: 0644]
src/or/dirserv.c

diff --git a/changes/fast_bw_param b/changes/fast_bw_param
new file mode 100644 (file)
index 0000000..abe630d
--- /dev/null
@@ -0,0 +1,8 @@
+  o Minor features (directory authority):
+    - Provide two consensus parameters (FastFlagMinThreshold and
+      FastFlagMaxThreshold) to control the range of allowable bandwidths for
+      the Fast directory flag. This allows authorities to run better
+      experiments on appropriate requirements for being a "Fast" node.
+      The AuthDirFastGuarantee flag still applies.
+
+
index 94a415fe21181957256ebf2978189b6a77048fca..e5995697dd91b7c26b96381c5573730db21a5b68 100644 (file)
@@ -1938,6 +1938,18 @@ dirserv_compute_performance_thresholds(routerlist_t *rl)
   if (guard_tk > TIME_KNOWN_TO_GUARANTEE_FAMILIAR)
     guard_tk = TIME_KNOWN_TO_GUARANTEE_FAMILIAR;
 
+  {
+    /* We can vote on a parameter for the minimum and maximum. */
+    int32_t min_fast, max_fast;
+    min_fast = networkstatus_get_param(NULL, "FastFlagMinThreshold",
+                                       0, 0, INT32_MAX);
+    max_fast = networkstatus_get_param(NULL, "FastFlagMaxThreshold",
+                                       INT32_MAX, min_fast, INT32_MAX);
+    if (fast_bandwidth < (uint32_t)min_fast)
+      fast_bandwidth = min_fast;
+    if (fast_bandwidth > (uint32_t)max_fast)
+      fast_bandwidth = max_fast;
+  }
   /* Protect sufficiently fast nodes from being pushed out of the set
    * of Fast nodes. */
   if (options->AuthDirFastGuarantee &&