[tor-bugs] #18881 [Core Tor/Stem]: speed up is_match() of stem/exit_policy.py

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Apr 30 00:34:31 UTC 2016


#18881: speed up is_match() of stem/exit_policy.py
---------------------------+------------------------
 Reporter:  toralf         |          Owner:  atagar
     Type:  defect         |         Status:  new
 Priority:  Medium         |      Milestone:
Component:  Core Tor/Stem  |        Version:
 Severity:  Normal         |     Resolution:
 Keywords:                 |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+------------------------

Comment (by atagar):

 Hmmm. Those checks aren't purely input validation. If they were then
 adding a 'bypass validation' argument makes sense for such a performance
 boon. But if you drop this whole block you'll get the wrong answer when
 matching IPv4 exit policies with IPv6 addresses and vice versa (that's
 what most of the code does).

 Per chance do you know what it is in here that's slow? If a single call
 (like is_valid_ipv4_address()) is the bottleneck then improving that might
 be a better route forward.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18881#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list