|
@@ -417,7 +417,7 @@ onion_populate_cpath(origin_circuit_t *circ)
|
|
|
circ->cpath->extend_info->identity_digest);
|
|
|
|
|
|
*/
|
|
|
- if (!node || !node_has_descriptor(node)) {
|
|
|
+ if (!node || !node_has_preferred_descriptor(node, 1)) {
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
@@ -1869,7 +1869,7 @@ choose_good_exit_server_general(int need_uptime, int need_capacity)
|
|
|
*/
|
|
|
continue;
|
|
|
}
|
|
|
- if (!node_has_descriptor(node)) {
|
|
|
+ if (!node_has_preferred_descriptor(node, 0)) {
|
|
|
n_supported[i] = -1;
|
|
|
continue;
|
|
|
}
|
|
@@ -2443,6 +2443,10 @@ circuit_extend_to_new_exit(origin_circuit_t *circ, extend_info_t *exit_ei)
|
|
|
|
|
|
|
|
|
* and available for building circuits through.
|
|
|
+ *
|
|
|
+ * (Note that this function may overcount or undercount, if we have
|
|
|
+ * descriptors that are not the type we would prefer to use for some
|
|
|
+ * particular router. See bug #25885.)
|
|
|
*/
|
|
|
MOCK_IMPL(STATIC int,
|
|
|
count_acceptable_nodes, (smartlist_t *nodes))
|
|
@@ -2847,9 +2851,10 @@ extend_info_new(const char *nickname,
|
|
|
* of the node (i.e. its IPv4 address) unless
|
|
|
* <b>for_direct_connect</b> is true, in which case the preferred
|
|
|
* address is used instead. May return NULL if there is not enough
|
|
|
- * info about <b>node</b> to extend to it--for example, if there is no
|
|
|
- * routerinfo_t or microdesc_t, or if for_direct_connect is true and none of
|
|
|
- * the node's addresses are allowed by tor's firewall and IP version config.
|
|
|
+ * info about <b>node</b> to extend to it--for example, if the preferred
|
|
|
+ * routerinfo_t or microdesc_t is missing, or if for_direct_connect is
|
|
|
+ * true and none of the node's addresses is allowed by tor's firewall
|
|
|
+ * and IP version config.
|
|
|
**/
|
|
|
extend_info_t *
|
|
|
extend_info_from_node(const node_t *node, int for_direct_connect)
|
|
@@ -2857,17 +2862,8 @@ extend_info_from_node(const node_t *node, int for_direct_connect)
|
|
|
tor_addr_port_t ap;
|
|
|
int valid_addr = 0;
|
|
|
|
|
|
- const int is_bridge = node_is_a_configured_bridge(node);
|
|
|
- const int we_use_mds = we_use_microdescriptors_for_circuits(get_options());
|
|
|
-
|
|
|
- if ((is_bridge && for_direct_connect) || !we_use_mds) {
|
|
|
-
|
|
|
- if (!node->ri)
|
|
|
- return NULL;
|
|
|
- } else {
|
|
|
-
|
|
|
- if (node->rs == NULL || node->md == NULL)
|
|
|
- return NULL;
|
|
|
+ if (!node_has_preferred_descriptor(node, for_direct_connect)) {
|
|
|
+ return NULL;
|
|
|
}
|
|
|
|
|
|
|