]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
entry_guard_pick_for_circuit(): TRAFFIC guards must have descriptors
authorNick Mathewson <nickm@torproject.org>
Tue, 31 Jan 2017 16:46:06 +0000 (11:46 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 31 Jan 2017 16:47:09 +0000 (11:47 -0500)
This relates to the 21242 fix -- entry_guard_pick_for_circuit()
should never yield nodes without descriptors when the node is going
to be used for traffic, since we won't be able to extend through
them.

src/or/entrynodes.c

index c5fb92e35a434a489814e4b6556e842510ed877d..344b69d65ff5552b462f665cc88f516b7306a487 100644 (file)
@@ -2068,6 +2068,8 @@ entry_guard_pick_for_circuit(guard_selection_t *gs,
   // XXXX prop271 check Ed ID.
   if (! node)
     goto fail;
+  if (BUG(usage != GUARD_USAGE_DIRGUARD && !node_has_descriptor(node)))
+    goto fail;
 
   *chosen_node_out = node;
   *guard_state_out = tor_malloc_zero(sizeof(circuit_guard_state_t));