aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2012-12-09 19:18:04 -0800
committerMike Perry <mikeperry-git@fscked.org>2012-12-09 19:18:04 -0800
commit930fbb2fec2b0c4e56cc4f10f8faec9d0d135274 (patch)
treec445c95119f07c68a498dcdaa06db8e546f81ef7
parent686fc222593fd46ec82d62f0fa62ca02900c1014 (diff)
downloadtor-930fbb2fec2b0c4e56cc4f10f8faec9d0d135274.tar
tor-930fbb2fec2b0c4e56cc4f10f8faec9d0d135274.tar.gz
Flag cannibalized circs as used (non-ideal).
Also add some comments.
-rw-r--r--src/or/circuitbuild.c4
-rw-r--r--src/or/circuituse.c17
2 files changed, 20 insertions, 1 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index c3a582758..7282d57c7 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1219,6 +1219,10 @@ pathbias_count_first_hop(origin_circuit_t *circ)
return 0;
}
+ // XXX: Technically, we could make this only count from the *second* hop..
+ // Until we get per-hop MACs or a lower circ failure rate, this might be
+ // better from a false positive POV. Should we s/first_hop/circ_attempt/g?
+ // Then we can control this check from the consensus.
if (circ->cpath->state == CPATH_STATE_AWAITING_KEYS) {
/* Help track down the real cause of bug #6475: */
if (circ->has_opened && circ->path_state != PATH_STATE_DID_FIRST_HOP) {
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 0b799b11a..781e98451 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1160,6 +1160,17 @@ circuit_has_opened(origin_circuit_t *circ)
{
control_event_circuit_status(circ, CIRC_EVENT_BUILT, 0);
+ /* Cannibalized circuits count as used for path bias.
+ * (PURPOSE_GENERAL circs especially, since they are
+ * marked dirty and often go unused after preemptive
+ * building). */
+ // XXX: Cannibalized now use RELAY_EARLY, which is visible
+ // to taggers end-to-end! We really need to probe these instead.
+ if (circ->has_opened &&
+ circ->build_state->desired_path_len > DEFAULT_ROUTE_LEN) {
+ circ->path_state = PATH_STATE_USE_SUCCEEDED;
+ }
+
/* Remember that this circuit has finished building. Now if we start
* it building again later (e.g. by extending it), we will know not
* to consider its build time. */
@@ -1411,7 +1422,11 @@ circuit_launch_by_extend_info(uint8_t purpose,
*
* Same deal goes for client side introductions. Clients
* can be manipulated to connect repeatedly to them
- * (especially web clients). */
+ * (especially web clients).
+ *
+ * If we decide to probe the initial portion of these circs,
+ * (up to the adversaries final hop), we need to remove this.
+ */
circ->path_state = PATH_STATE_USE_SUCCEEDED;
/* This must be called before the purpose change */
pathbias_check_close(circ);