diff --git a/changes/bug18859 b/changes/bug18859 new file mode 100644 index 0000000000..993074079c --- /dev/null +++ b/changes/bug18859 @@ -0,0 +1,5 @@ + o Minor bugfixes (circuit prediction): + - Fix circuit_stream_is_being_handled so it correctly reports on circuits + with isolation settings. Ports must not be said to be "handled" by + already-isolated circuits, and a stream can only be handled by a circuit + if their isolation settings are compatible. Fixes bug 18859. diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 9f9d3abf7c..6378cb8ac3 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -973,7 +973,7 @@ circuit_remove_handled_ports(smartlist_t *needed_ports) tor_assert(*port); if (circuit_stream_is_being_handled(NULL, *port, MIN_CIRCUITS_HANDLING_STREAM)) { -// log_debug(LD_CIRC,"Port %d is already being handled; removing.", port); + log_debug(LD_CIRC,"Port %d is already being handled; removing.", *port); smartlist_del(needed_ports, i--); tor_free(port); } else { @@ -1010,6 +1010,10 @@ circuit_stream_is_being_handled(entry_connection_t *conn, continue; if (origin_circ->unusable_for_new_conns) continue; + if (origin_circ->isolation_values_set && + (conn == NULL || + !connection_edge_compatible_with_circuit(conn, origin_circ))) + continue; exitnode = build_state_get_exit_node(build_state); if (exitnode && (!need_uptime || build_state->need_uptime)) {