[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.4.0] num_bridges_usable(): only count configured bridges.



commit 8015979eeba2c8b10fb058318628debf228fb023
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri May 31 12:19:29 2019 -0400

    num_bridges_usable(): only count configured bridges.
    
    When this function was implemented, it counted all the entry guards
    in the bridge set.  But this included previously configured bridges,
    as well as currently configured ones!  Instead, only count the
    _filtered_ bridges (ones that are configured and possibly reachable)
    as maybe usable.
    
    Fixes bug 29875; bugfix on 0.3.0.1-alpha.
---
 src/feature/client/entrynodes.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index e543289ce..15ec83059 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -3300,6 +3300,9 @@ num_bridges_usable,(int use_maybe_reachable))
   }
 
   SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
+    /* Not a bridge, or not one we are configured to be able to use. */
+    if (! guard->is_filtered_guard)
+      continue;
     /* Definitely not usable */
     if (guard->is_reachable == GUARD_REACHABLE_NO)
       continue;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits