Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
juga
sbws
Commits
e4433c79
Commit
e4433c79
authored
Aug 11, 2020
by
Georg Koppen
Browse files
Merge remote-tracking branch 'gitlab/merge-requests/24' into maint-1.1
parents
b9f92100
ca20d828
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/lib/relaylist.py
View file @
e4433c79
...
@@ -181,6 +181,10 @@ class Relay:
...
@@ -181,6 +181,10 @@ class Relay:
"""
"""
Returns True if the relay has an exit policy and the policy accepts
Returns True if the relay has an exit policy and the policy accepts
exiting to the given portself or False otherwise.
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
)
assert
isinstance
(
port
,
int
)
# if dind't get the descriptor, there isn't exit policy
# if dind't get the descriptor, there isn't exit policy
...
@@ -199,7 +203,12 @@ class Relay:
...
@@ -199,7 +203,12 @@ class Relay:
if
self
.
exit_policy
:
if
self
.
exit_policy
:
# Using `strict` to ensure it can exit to ALL domains
# Using `strict` to ensure it can exit to ALL domains
# and ips and that port. See #40006.
# 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
:
except
TypeError
:
return
False
return
False
return
False
return
False
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment