diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-09-21 21:48:42 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-09-21 21:48:42 +0000 |
commit | 6a1746f98f58fd22dce2ce34840b10012b5467dd (patch) | |
tree | c841e8d0e7522e31543583c32cc4358a2dfcc6af /src/or/policies.c | |
parent | d273d529798e44c315c94437f27c3a1349794179 (diff) | |
download | tor-6a1746f98f58fd22dce2ce34840b10012b5467dd.tar.gz tor-6a1746f98f58fd22dce2ce34840b10012b5467dd.zip |
r8877@Kushana: nickm | 2006-09-21 17:12:33 -0400
Consider non-exit servers unsuitable for RESOLVE commands.
svn:r8442
Diffstat (limited to 'src/or/policies.c')
-rw-r--r-- | src/or/policies.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index bee8324ea4..f2f7cf8aab 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -629,6 +629,22 @@ exit_policy_is_general_exit(addr_policy_t *policy) return n_allowed >= 2; } +/** Return false if <b>policy</b> might permit access to some addr:port; + * otherwise if we are certain it rejects everything, return true. */ +int +policy_is_reject_star(addr_policy_t *p) +{ + for ( ; p; p = p->next) { + if (p->policy_type == ADDR_POLICY_ACCEPT) + return 0; + else if (p->policy_type == ADDR_POLICY_REJECT && + p->prt_min <= 1 && p->prt_max == 65535 && + p->msk == 0) + return 1; + } + return 1; +} + int policies_getinfo_helper(const char *question, char **answer) { |