diff options
author | Roger Dingledine <arma@torproject.org> | 2006-06-13 02:48:06 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-06-13 02:48:06 +0000 |
commit | 19408cf8d77218f00707f31dc85fbb040b5c7b5b (patch) | |
tree | d749ca6ab2c61d87b065ca40c80ea17b1df3f571 /src/or/policies.c | |
parent | cce8ae1190ce205b4cd8905ef547d3deb6531695 (diff) | |
download | tor-19408cf8d77218f00707f31dc85fbb040b5c7b5b.tar tor-19408cf8d77218f00707f31dc85fbb040b5c7b5b.tar.gz |
reintroduce the logic to exit_policy_is_general_exit() to count
how many ports are allowd. require two ports open, not just one.
svn:r6609
Diffstat (limited to 'src/or/policies.c')
-rw-r--r-- | src/or/policies.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index b7946f920..7eff70fc9 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -603,11 +603,12 @@ policies_parse_exit_policy(config_line_t *cfg, addr_policy_t **dest, /** 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 - * one of ports 80, 443, and 6667. */ + * two of ports 80, 443, and 6667. */ int exit_policy_is_general_exit(addr_policy_t *policy) { static const int ports[] = { 80, 443, 6667 }; + int n_allowed = 0; int i; for (i = 0; i < 3; ++i) { struct addr_policy_t *p = policy; @@ -620,10 +621,10 @@ exit_policy_is_general_exit(addr_policy_t *policy) continue; /* 127.x */ /* We have a match that is at least a /8. */ if (p->policy_type == ADDR_POLICY_ACCEPT) - return 1; + ++n_allowed; } } - return 0; + return n_allowed >= 2; } /** Release all storage held by <b>p</b> */ |