GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit b1b3c35c authored by Georg Koppen's avatar Georg Koppen

Merge branch 'maint-1.1' into master

parents 88a8c220 e4433c79
......@@ -181,6 +181,10 @@ class Relay:
"""
Returns True if the relay has an exit policy and the policy accepts
exiting to the given portself or False otherwise.
The exits that are IPv6 only or IPv4 but rejecting some public networks
will return false.
On July 2020, there were 67 out of 1095 exits like this.
"""
assert isinstance(port, int)
# if dind't get the descriptor, there isn't exit policy
......@@ -199,7 +203,12 @@ class Relay:
if self.exit_policy:
# Using `strict` to ensure it can exit to ALL domains
# and ips and that port. See #40006.
return self.exit_policy.can_exit_to(port=port, strict=True)
# Using `strip_private` to ignore reject rules to private
# networks.
return (
self.exit_policy.strip_private()
.can_exit_to(port=port, strict=True)
)
except TypeError:
return False
return False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment