torproject / stem

Python controller library for Tor
https://stem.torproject.org/
GNU Lesser General Public License v3.0
273 stars 76 forks source link

IPv6 support #74

Closed jpds closed 4 years ago

jpds commented 4 years ago

https://github.com/atx/prometheus-tor_exporter uses this module and using a valid IPv6 address returns:

$ sudo /usr/bin/prometheus-tor-exporter.py -m tcp -a '2a01:XXXX:XXXX:XXX::XX'
Traceback (most recent call last):
  File "/usr/bin/prometheus-tor-exporter.py", line 197, in <module>
    port=args.control_port)
  File "/usr/lib/python3/dist-packages/stem/control.py", line 1014, in from_port
    raise ValueError('Invalid IP address: %s' % address)
ValueError: Invalid IP address: 2a01:XXXX:XXXX:XXX::XX
atagar commented 4 years ago

Thanks Jonathan, good catch. I'm not all together sure if a remote IPv6 control connection will work (unfortunately I don't have an IPv6 relay to test against), but I fixed that validation check...

https://gitweb.torproject.org/stem.git/commit/?id=1087ebf