aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/channel.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2020-08-12 13:23:33 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2020-08-12 13:23:33 +0300
commitc591a0d2466cdc644fd82519f6f1ec32da764287 (patch)
tree8ca4a3798b167d056439a3219e0b11f396f0744d /src/core/or/channel.c
parent2f708079cd912eb70384002ff3ab29ff2d224ed4 (diff)
parent8e9edb93be7771e44352c539abdf0b269ac56fab (diff)
downloadtor-c591a0d2466cdc644fd82519f6f1ec32da764287.tar.gz
tor-c591a0d2466cdc644fd82519f6f1ec32da764287.zip
Merge branch 'maint-0.4.4'
Diffstat (limited to 'src/core/or/channel.c')
-rw-r--r--src/core/or/channel.c46
1 files changed, 7 insertions, 39 deletions
diff --git a/src/core/or/channel.c b/src/core/or/channel.c
index 5a42d452f2..91f083ec00 100644
--- a/src/core/or/channel.c
+++ b/src/core/or/channel.c
@@ -780,10 +780,9 @@ channel_check_for_duplicates(void)
if (is_dirauth)
total_dirauth_connections++;
- if (chan->is_canonical(chan, 0)) total_canonical++;
+ if (chan->is_canonical(chan)) total_canonical++;
- if (!chan->is_canonical_to_peer && chan->is_canonical(chan, 0)
- && chan->is_canonical(chan, 1)) {
+ if (!chan->is_canonical_to_peer && chan->is_canonical(chan)) {
total_half_canonical++;
}
}
@@ -2450,21 +2449,9 @@ channel_get_for_extend,(const char *rsa_id_digest,
continue;
}
- /* If the connection is using a recent link protocol, only return canonical
- * connections, when the address is one of the addresses we wanted.
- *
- * The channel_is_canonical_is_reliable() function asks the lower layer
- * if we should trust channel_is_canonical(). It only applies when
- * the lower-layer transport is channel_tls_t.
- *
- * For old link protocols, we can't rely on is_canonical getting
- * set properly if we're talking to the right address, since we might
- * have an out-of-date descriptor, and we will get no NETINFO cell to
- * tell us about the right address.
- */
- if (!channel_is_canonical(chan) &&
- channel_is_canonical_is_reliable(chan) &&
- !matches_target) {
+ /* Only return canonical connections or connections where the address
+ * is the address we wanted. */
+ if (!channel_is_canonical(chan) && !matches_target) {
++n_noncanonical;
continue;
}
@@ -2605,16 +2592,12 @@ channel_dump_statistics, (channel_t *chan, int severity))
/* Handle marks */
tor_log(severity, LD_GENERAL,
- " * Channel %"PRIu64 " has these marks: %s %s %s "
- "%s %s %s",
+ " * Channel %"PRIu64 " has these marks: %s %s %s %s %s",
(chan->global_identifier),
channel_is_bad_for_new_circs(chan) ?
"bad_for_new_circs" : "!bad_for_new_circs",
channel_is_canonical(chan) ?
"canonical" : "!canonical",
- channel_is_canonical_is_reliable(chan) ?
- "is_canonical_is_reliable" :
- "!is_canonical_is_reliable",
channel_is_client(chan) ?
"client" : "!client",
channel_is_local(chan) ?
@@ -2939,22 +2922,7 @@ channel_is_canonical(channel_t *chan)
tor_assert(chan);
tor_assert(chan->is_canonical);
- return chan->is_canonical(chan, 0);
-}
-
-/**
- * Test if the canonical flag is reliable.
- *
- * This function asks if the lower layer thinks it's safe to trust the
- * result of channel_is_canonical().
- */
-int
-channel_is_canonical_is_reliable(channel_t *chan)
-{
- tor_assert(chan);
- tor_assert(chan->is_canonical);
-
- return chan->is_canonical(chan, 1);
+ return chan->is_canonical(chan);
}
/**