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
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 fora.version != 4
, to skip IPv6 addresses.Should this be added to txtorcon?