summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2013-01-22 21:03:28 -0800
committerMike Perry <mikeperry-git@fscked.org>2013-01-22 21:03:28 -0800
commita78542f0c30a6d8a25b3a8c92fec61c04c3feeaf (patch)
treede128b765bc631ace727b9d8149082d9a4209b4c /src/or
parentb810d322bfc55d202dbbd2e8ebe4529cf0778c8b (diff)
downloadtor-a78542f0c30a6d8a25b3a8c92fec61c04c3feeaf.tar.gz
tor-a78542f0c30a6d8a25b3a8c92fec61c04c3feeaf.zip
Bug 8024: Check for null/closed channel before probing.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitbuild.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 97a26dd307..e3a9d59c0e 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1727,6 +1727,16 @@ pathbias_send_usable_probe(circuit_t *circ)
return -1;
}
+ /* Can't probe if the channel isn't open */
+ if (circ->n_chan == NULL ||
+ (circ->n_chan->state != CHANNEL_STATE_OPEN
+ && circ->n_chan->state != CHANNEL_STATE_MAINT)) {
+ log_info(LD_CIRC,
+ "Skipping pathbias probe for circuit %d: Channel is not open.",
+ ocirc->global_identifier);
+ return -1;
+ }
+
circuit_change_purpose(circ, CIRCUIT_PURPOSE_PATH_BIAS_TESTING);
/* Update timestamp for when circuit_expire_building() should kill us */