Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Silvio Rhatto
Tor
Commits
0d91cb80
Commit
0d91cb80
authored
Apr 14, 2022
by
David Goulet
🐼
Browse files
Merge branch 'maint-0.4.5' into release-0.4.5
parents
63d698b9
dc90226c
Changes
4
Hide whitespace changes
Inline
Side-by-side
changes/bug40515
0 → 100644
View file @
0d91cb80
o Minor bugfixes (controller, path bias):
- When a circuit's path is specified, in full or in part, from the
controller API, do not count that circuit towards our path-bias
calculations. (Doing so was incorrect, since we cannot tell whether
the controller is selecting relays randomly.) Resolves a "Bug"
warning. Fixes bug 40515; bugfix on 0.2.4.10-alpha.
src/core/or/origin_circuit_st.h
View file @
0d91cb80
...
...
@@ -182,6 +182,12 @@ struct origin_circuit_t {
*/
unsigned
first_hop_from_controller
:
1
;
/**
* If true, this circuit's path has been chosen, in full or in part,
* by the controller API, and it's okay to ignore checks that we'd
* usually do on the path as whole. */
unsigned
int
any_hop_from_controller
:
1
;
/**
* Tristate variable to guard against pathbias miscounting
* due to circuit purpose transitions changing the decision
...
...
src/feature/client/circpathbias.c
View file @
0d91cb80
...
...
@@ -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
)
{
...
...
src/feature/control/control_cmd.c
View file @
0d91cb80
...
...
@@ -822,6 +822,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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment