Opened 7 years ago

Closed 7 years ago

#9181 closed defect (fixed)

"ProtocolError: Target location's port is invalid" when STREAM event target is IPv6 address

Reported by: soult Owned by: atagar
Priority: Medium Milestone:
Component: Archived/Stem Version:
Severity: Keywords: ipv6
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


david@hotdog:~/scm/git/stem$ ./ 
Exception in thread Event Notifier:
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/david/scm/git/stem/stem/", line 609, in _event_loop
  File "/home/david/scm/git/stem/stem/", line 2303, in _handle_event
    stem.response.convert("EVENT", event_message, arrived_at = time.time())
  File "/home/david/scm/git/stem/stem/response/", line 128, in convert
  File "/home/david/scm/git/stem/stem/response/", line 66, in _parse_message
  File "/home/david/scm/git/stem/stem/response/", line 828, in _parse
    raise stem.ProtocolError("Target location's port is invalid: %s" % self)
ProtocolError: Target location's port is invalid: STREAM 105 NEWRESOLVE 0 2001:db8::1:0 PURPOSE=DNS_REQUEST

Child Tickets

Attachments (1) (316 bytes) - added by soult 7 years ago.
Triggers the bug by creating a reverse DNS request for an IPv6 address

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by soult

Attachment: added

Triggers the bug by creating a reverse DNS request for an IPv6 address

comment:1 Changed 7 years ago by soult

Status: newneeds_review

Since Tor does not normally have an IPv6 address as stream target, this bug is (afaik) only triggered when doing reverse DNS resolution. From the control spec it is clear that the target will always end with ":" Port, so the fix is to only split on the last colon using rsplit.

A patch can be found in the branch bug-9181 of my stem repository clone[1]. (Diff[2]).


comment:2 Changed 7 years ago by atagar

Resolution: fixed
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.