[tor-bugs] #18929 [Core Tor/Tor]: Fix selection of directories with non-preferred address families

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Apr 30 01:39:47 UTC 2016


#18929: Fix selection of directories with non-preferred address families
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:
     Type:  defect                               |         Status:
 Priority:  Medium                               |  needs_review
Component:  Core Tor/Tor                         |      Milestone:  Tor:
 Severity:  Normal                               |  0.2.8.x-final
 Keywords:  must-fix-before-028-rc,              |        Version:  Tor:
  CoreTorTeam201605                              |  0.2.8.1-alpha
Parent ID:  #18483                               |     Resolution:
 Reviewer:  isis                                 |  Actual Points:  2 hours
                                                 |         Points:  small
                                                 |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by teor):

 * status:  needs_revision => needs_review


Comment:

 Replying to [comment:4 isis]:
 > Replying to [comment:1 teor]:
 > > See commit
 > > e6f859c Make directory node selection for IPv4 bridge clients more
 reliable
 > > in my branch feature18483 on ​https://github.com/teor2345/tor.git
 >
 > `router_has_non_preferred_address()` will return true if the
 `routerstatus_t` has both an IPv4 and an IPv6 address… regardless of
 whether IPv4 or IPv6 is preferred.  This might still mess up the
 `n_non_preferred` count?

 That's the intended behaviour - we want to know if there's any point in
 trying the non-preferred IP family. So we count the number of relays we
 might choose if we don't get any reachable relays from our preferred IP
 family.
 To do that, we look for a valid address from the non-preferred family.
 If it has an IPv4 and IPv6 address, it definitely has an address from the
 non-preferred family.

 But there's a bug, it's not checking node-specific preferences, which
 matter for bridge clients:
 f48abb6 Use bridge client node-specific IPv6 preferences where available

 > If that's the right behaviour, then there's a unittest for you, for
 `router_has_non_preferred_address()`, in my `bug18929`
 [https://gitweb.torproject.org/user/isis/tor.git/log/?h=bug18929 branch]
 (based on your `feature18483`). Otherwise we should make the unittest do
 the intended thing and then revise.

 Thanks for the unit test.

 Cherry picked your bug18929 branch as:
 2695ace Add unittest for router_has_non_preferred_address().

 I changed the function name in f48abb6, so I needed to change it in the
 unit test as well:
 c198259 Tweak unit test so it tests router_has_non_preferred_address_rs

 That should be it!

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


More information about the tor-bugs mailing list