diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2016-09-05 23:32:16 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2016-09-05 23:39:47 +0200 |
commit | 0d485fcfeff530a1f299d84195d1c35b8f313856 (patch) | |
tree | e3cfcf6822b5370163aef129dabbd5aee194fc35 /src/or/policies.c | |
parent | 341a159ab4ec9cb0a07a6f3507c4eb5aaf83798a (diff) | |
download | tor-0d485fcfeff530a1f299d84195d1c35b8f313856.tar.gz tor-0d485fcfeff530a1f299d84195d1c35b8f313856.zip |
Vote Exit correctly with DirAllowPrivateAddresses set
When allowing private addresses, mark Exits that only exit to private
locations as such. Fixes bug 20064; bugfix on 0.2.2.9-alpha.
Diffstat (limited to 'src/or/policies.c')
-rw-r--r-- | src/or/policies.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index 07f256f5cc..44a46d2fe2 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -2119,8 +2119,10 @@ exit_policy_is_general_exit_helper(smartlist_t *policy, int port) if (subnet_status[i] != 0) continue; /* We already reject some part of this /8 */ tor_addr_from_ipv4h(&addr, i<<24); - if (tor_addr_is_internal(&addr, 0)) + if (tor_addr_is_internal(&addr, 0) && + !get_options()->DirAllowPrivateAddresses) { continue; /* Local or non-routable addresses */ + } if (p->policy_type == ADDR_POLICY_ACCEPT) { if (p->maskbits > 8) continue; /* Narrower than a /8. */ |