[tor-commits] [tor/master] Make entry_guard_set_status consistent with entry_is_live

nickm at torproject.org nickm at torproject.org
Thu Feb 11 17:37:18 UTC 2016


commit 4528f893163ad7ab27915451caf23b3a722413ce
Author: teor (Tim Wilson-Brown) <teor2345 at gmail.com>
Date:   Sun Jan 3 23:16:06 2016 +1100

    Make entry_guard_set_status consistent with entry_is_live
    
    Check fascist_firewall_allows_node in entry_guard_set_status and
    return the same message as entry_is_live.
---
 src/or/entrynodes.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 583b7ef..1ce44d1 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -87,7 +87,7 @@ get_entry_guards(void)
 
 /** Check whether the entry guard <b>e</b> is usable, given the directory
  * authorities' opinion about the router (stored in <b>ri</b>) and the user's
- * configuration (in <b>options</b>). Set <b>e</b>->bad_since
+ * configuration (in <b>options</b>). Set <b>e</b>->bad_since
  * accordingly. Return true iff the entry guard's status changes.
  *
  * If it's not usable, set *<b>reason</b> to a static string explaining why.
@@ -117,6 +117,9 @@ entry_guard_set_status(entry_guard_t *e, const node_t *node,
     *reason = "not recommended as a guard";
   else if (routerset_contains_node(options->ExcludeNodes, node))
     *reason = "excluded";
+  /* We only care about OR connection connectivity for entry guards. */
+  else if (!fascist_firewall_allows_node(node, FIREWALL_OR_CONNECTION, 0))
+    *reason = "unreachable by config";
   else if (e->path_bias_disabled)
     *reason = "path-biased";
 





More information about the tor-commits mailing list