summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2014-10-26 20:56:15 +0200
committerNick Mathewson <nickm@torproject.org>2014-10-28 14:07:08 -0400
commitf1ebe6bda4f541a54648d02e2d51fc9073c3786d (patch)
tree73b5e330513a6729bbcc1a6506419af2520d1b2f /src/or/or.h
parent2c884fd8cc0a7a8c42003e10b5033deb5a7d6d99 (diff)
downloadtor-f1ebe6bda4f541a54648d02e2d51fc9073c3786d.tar.gz
tor-f1ebe6bda4f541a54648d02e2d51fc9073c3786d.zip
Fix smartlist_choose_node_by_bandwidth() so that it rejects ORs with BadExit flag.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 115b92dc94..2c79c13efb 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3228,6 +3228,14 @@ static const or_circuit_t *CONST_TO_OR_CIRCUIT(const circuit_t *);
static origin_circuit_t *TO_ORIGIN_CIRCUIT(circuit_t *);
static const origin_circuit_t *CONST_TO_ORIGIN_CIRCUIT(const circuit_t *);
+/** Return 1 iff <b>node</b> has Exit flag and no BadExit flag.
+ * Otherwise, return 0.
+ */
+static INLINE int node_is_good_exit(const node_t *node)
+{
+ return node->is_exit && ! node->is_bad_exit;
+}
+
static INLINE or_circuit_t *TO_OR_CIRCUIT(circuit_t *x)
{
tor_assert(x->magic == OR_CIRCUIT_MAGIC);