aboutsummaryrefslogtreecommitdiff
path: root/src/feature/client/circpathbias.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2022-04-14 09:37:43 -0400
committerDavid Goulet <dgoulet@torproject.org>2022-04-14 09:37:43 -0400
commitdc90226cc3c7c74164f8feb1f50d2fbcf0941a9d (patch)
treef99b5178822692438a8fc4a119390e619a77b049 /src/feature/client/circpathbias.c
parent9ac479ce1c20fd2e58528900b54d5b81bedb641d (diff)
parentdd085d42f96e39f9387aa1d7a306100c0d7df305 (diff)
downloadtor-dc90226cc3c7c74164f8feb1f50d2fbcf0941a9d.tar.gz
tor-dc90226cc3c7c74164f8feb1f50d2fbcf0941a9d.zip
Merge branch 'tor-gitlab/mr/491' into maint-0.4.5
Diffstat (limited to 'src/feature/client/circpathbias.c')
-rw-r--r--src/feature/client/circpathbias.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/feature/client/circpathbias.c b/src/feature/client/circpathbias.c
index 4d27553926..29264135f9 100644
--- a/src/feature/client/circpathbias.c
+++ b/src/feature/client/circpathbias.c
@@ -363,6 +363,17 @@ pathbias_should_count(origin_circuit_t *circ)
return 0;
}
+ /* Ignore circuits where the controller helped choose the path. When
+ * this happens, we can't be sure whether the path was chosen randomly
+ * or not. */
+ if (circ->any_hop_from_controller) {
+ /* (In this case, we _don't_ check to see if shouldcount is changing,
+ * since it's possible that an already-created circuit later gets extended
+ * by the controller. */
+ circ->pathbias_shouldcount = PATHBIAS_SHOULDCOUNT_IGNORED;
+ return 0;
+ }
+
/* Completely ignore one hop circuits */
if (circ->build_state->onehop_tunnel ||
circ->build_state->desired_path_len == 1) {