summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-13 11:20:20 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-13 11:20:20 -0500
commit3300a6e93aa9e6adfe9c6bb7949b3774e98b94f8 (patch)
treeb09027e6dff2697e5fe50b4526e073724e1f2f79 /src
parentcf1e6ad2d72696bc788b02c0f51581361f271d67 (diff)
parent8dff23eb34cf63278f8c78eb965c77fe215b860c (diff)
downloadtor-3300a6e93aa9e6adfe9c6bb7949b3774e98b94f8.tar.gz
tor-3300a6e93aa9e6adfe9c6bb7949b3774e98b94f8.zip
Merge remote-tracking branch 'arma/ticket23637' into maint-0.3.2
Diffstat (limited to 'src')
-rw-r--r--src/or/policies.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index 4c24bfbc32..78451db8fc 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -2186,21 +2186,16 @@ exit_policy_is_general_exit_helper(smartlist_t *policy, int port)
}
/** Return true iff <b>ri</b> is "useful as an exit node", meaning
- * it allows exit to at least one /8 address space for at least
- * two of ports 80, 443, and 6667. */
+ * it allows exit to at least one /8 address space for each of ports 80
+ * and 443. */
int
exit_policy_is_general_exit(smartlist_t *policy)
{
- static const int ports[] = { 80, 443, 6667 };
- int n_allowed = 0;
- int i;
if (!policy) /*XXXX disallow NULL policies? */
return 0;
- for (i = 0; i < 3; ++i) {
- n_allowed += exit_policy_is_general_exit_helper(policy, ports[i]);
- }
- return n_allowed >= 2;
+ return (exit_policy_is_general_exit_helper(policy, 80) &&
+ exit_policy_is_general_exit_helper(policy, 443));
}
/** Return false if <b>policy</b> might permit access to some addr:port;