From dc3229313b6d2aaff437c6fc7fa55ead4409e93d Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Wed, 16 Sep 2009 02:23:04 +0200 Subject: Teach connection_ap_can_use_exit about Exclude*Nodes To further attempt to fix bug 1090, make sure connection_ap_can_use_exit always returns 0 when the chosen exit router is excluded. This should fix bug1090. --- src/or/connection_edge.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/or/connection_edge.c') diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index d699591cd..ba1304a65 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -2851,11 +2851,13 @@ connection_edge_is_rendezvous_stream(edge_connection_t *conn) /** Return 1 if router exit is likely to allow stream conn * to exit from it, or 0 if it probably will not allow it. * (We might be uncertain if conn's destination address has not yet been - * resolved.) + * resolved.) If the router is in the list of excluded nodes, also return 0; */ int connection_ap_can_use_exit(edge_connection_t *conn, routerinfo_t *exit) { + or_options_t *options = get_options(); + tor_assert(conn); tor_assert(conn->_base.type == CONN_TYPE_AP); tor_assert(conn->socks_request); @@ -2901,6 +2903,10 @@ connection_ap_can_use_exit(edge_connection_t *conn, routerinfo_t *exit) if (!conn->chosen_exit_name && policy_is_reject_star(exit->exit_policy)) return 0; } + if (options->_ExcludeExitNodesUnion && + routerset_contains_router(options->_ExcludeExitNodesUnion, exit)) + return 0; + return 1; } -- cgit v1.2.3