diff options
author | David Goulet <dgoulet@torproject.org> | 2022-04-14 09:37:46 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2022-04-14 09:37:46 -0400 |
commit | 18cc67f1614a3819b55883a421710a59a66c27a5 (patch) | |
tree | 919c8d2163caacac48bce4b1c673511c7d031e0f /src/feature | |
parent | c54e1cba011b14dfe39c3c181c5a8c9f08b0be69 (diff) | |
parent | 32356a607608596a0607c80eb8505dedfc315894 (diff) | |
download | tor-18cc67f1614a3819b55883a421710a59a66c27a5.tar.gz tor-18cc67f1614a3819b55883a421710a59a66c27a5.zip |
Merge branch 'maint-0.4.6' into release-0.4.6
Diffstat (limited to 'src/feature')
-rw-r--r-- | src/feature/client/circpathbias.c | 11 | ||||
-rw-r--r-- | src/feature/control/control_cmd.c | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/feature/client/circpathbias.c b/src/feature/client/circpathbias.c index 9c0ecc56ad..ff9e05a645 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) { diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c index bd0d41d29e..94a5645cff 100644 --- a/src/feature/control/control_cmd.c +++ b/src/feature/control/control_cmd.c @@ -817,6 +817,8 @@ handle_control_extendcircuit(control_connection_t *conn, circ->first_hop_from_controller = 1; } + circ->any_hop_from_controller = 1; + /* now circ refers to something that is ready to be extended */ first_node = zero_circ; SMARTLIST_FOREACH(nodes, const node_t *, node, |