]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Ignore tiny bandwidths entirely when computing thresholds
authorNick Mathewson <nickm@torproject.org>
Mon, 4 Feb 2013 15:47:08 +0000 (10:47 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 4 Feb 2013 15:47:08 +0000 (10:47 -0500)
Another bug 8145 fix.

changes/bug8146_etc
src/or/dirserv.c

index 3775aa5059b36d6e528fcaf0b7ba7ec603306451..274e2abe48c646a53c9207ba25c5520a7e46cc31 100644 (file)
@@ -5,3 +5,6 @@
 
     - When computing thresholds for flags, never let the threshold for
       the Fast flag to 4096 bytes. Fixes bug 8145.
+    - Do not consider nodes with extremely low bandwidths when deciding
+      thresholds for various directory flags. Another fix for 8145.
+
index f3cb2de9188e4555d3ec6f8250a79b8aed192b22..0c3e72f3a32df5c6033407567974d1f116956546 100644 (file)
@@ -1884,6 +1884,10 @@ dirserv_thinks_router_is_hs_dir(const routerinfo_t *router,
           node->is_running);
 }
 
+/** Don't consider routers with less bandwidth than this when computing
+ * thresholds. */
+#define ABSOLUTE_MIN_BW_VALUE_TO_CONSIDER 4096
+
 /** Helper for dirserv_compute_performance_thresholds(): Decide whether to
  * include a router in our calculations, and return true iff we should. */
 static int
@@ -1891,7 +1895,9 @@ router_counts_toward_thresholds(const node_t *node, time_t now,
                                 const digestmap_t *omit_as_sybil)
 {
   return node->ri && router_is_active(node->ri, node, now) &&
-    !digestmap_get(omit_as_sybil, node->ri->cache_info.identity_digest);
+    !digestmap_get(omit_as_sybil, node->ri->cache_info.identity_digest) &&
+    (router_get_advertised_bandwidth(node->ri) >=
+       ABSOLUTE_MIN_BW_VALUE_TO_CONSIDER);
 }
 
 /** Look through the routerlist, the Mean Time Between Failure history, and