Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does stream_via() reject ipv6 addresses? #239

Open
warner opened this issue May 24, 2017 · 2 comments
Open

does stream_via() reject ipv6 addresses? #239

warner opened this issue May 24, 2017 · 2 comments

Comments

@warner
Copy link
Contributor

warner commented May 24, 2017

I'm updating magic-wormhole to use the new txtorcon APIs, and I noticed one difference between the _is_non_public_numeric_address() function in txtorcon and the one in magic-wormhole that inspired it. The magic-wormhole one checks for a.version != 4, to skip IPv6 addresses.

Should this be added to txtorcon?

diff --git a/txtorcon/controller.py b/txtorcon/controller.py
index 61b6ac2..f534ae3 100644
--- a/txtorcon/controller.py
+++ b/txtorcon/controller.py
@@ -663,7 +663,7 @@ def _is_non_public_numeric_address(host):
     except ValueError:
         return False        # non-numeric, let Tor try it
     if a.is_loopback or a.is_multicast or a.is_private or a.is_reserved \
-       or a.is_unspecified:
+       or a.is_unspecified or a.version != 4:
         return True         # too weird, don't connect
     return False
@warner
Copy link
Contributor Author

warner commented May 24, 2017

Oh, I see test_controller.TorStreamTests.test_public_v6, which has a comment that says "should not be an error". Does Tor handle IPv6 these days?

@meejah
Copy link
Owner

meejah commented May 24, 2017

Yes, Tor handles IPv6 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants