[tor-commits] [tor/master] Fix pathbias interactions with entry guards

nickm at torproject.org nickm at torproject.org
Fri Dec 16 16:26:18 UTC 2016


commit d98b9b6d65946e14ee325327d5beac1a60ace6cc
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Nov 22 15:30:12 2016 -0500

    Fix pathbias interactions with entry guards
    
    entry_guard_get_by_id_digest() was always returning NULL, which was
    causing "adventure" and "fun"
---
 src/or/entrynodes.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index f1fc055..81751f5 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -2351,6 +2351,11 @@ entry_guard_get_by_id_digest_for_guard_selection(guard_selection_t *gs,
 {
   tor_assert(gs != NULL);
 
+  SMARTLIST_FOREACH(gs->sampled_entry_guards, entry_guard_t *, entry,
+                    if (tor_memeq(digest, entry->identity, DIGEST_LEN))
+                      return entry;
+                   );
+
   SMARTLIST_FOREACH(gs->chosen_entry_guards, entry_guard_t *, entry,
                     if (tor_memeq(digest, entry->identity, DIGEST_LEN))
                       return entry;





More information about the tor-commits mailing list