aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-04-16 10:38:55 -0400
committerNick Mathewson <nickm@torproject.org>2018-04-22 19:42:26 -0400
commit948dd2c79ea9ca1fd06c13f275515a1745c46986 (patch)
treeafc311f00bca225b6745b4778a73f38d741c6eb9 /src/or/circuituse.c
parent22845df2a7503ed73ed325c3a98916f289918caa (diff)
downloadtor-948dd2c79ea9ca1fd06c13f275515a1745c46986.tar.gz
tor-948dd2c79ea9ca1fd06c13f275515a1745c46986.zip
Check for "the right descriptor", not just "any descriptor".
This patch adds a new node_has_preferred_descriptor() function, and replaces most users of node_has_descriptor() with it. That's an important change, since as of d1874b433953f64 (our fix for #25213), we are willing to say that a node has _some_ descriptor, but not the _right_ descriptor for a particular use case. Part of a fix for 25691 and 25692.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 3125fff650..5d8af4c6c8 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -2384,7 +2384,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
const node_t *r;
int opt = conn->chosen_exit_optional;
r = node_get_by_nickname(conn->chosen_exit_name, 0);
- if (r && node_has_descriptor(r)) {
+ if (r && node_has_preferred_descriptor(r, conn->want_onehop ? 1 : 0)) {
/* We might want to connect to an IPv6 bridge for loading
descriptors so we use the preferred address rather than
the primary. */
@@ -2394,7 +2394,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
"Discarding this circuit.", conn->chosen_exit_name);
return -1;
}
- } else { /* ! (r && node_has_descriptor(r)) */
+ } else { /* ! (r && node_has_preferred_descriptor(...)) */
log_debug(LD_DIR, "considering %d, %s",
want_onehop, conn->chosen_exit_name);
if (want_onehop && conn->chosen_exit_name[0] == '$') {