[tor-bugs] #23318 [Core Tor/Tor]: compute_weighted_bandwidths: do not add 0.5 to final_weight

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Sep 29 10:18:36 UTC 2017


#23318: compute_weighted_bandwidths: do not add 0.5 to final_weight
-------------------------------------------------+-------------------------
 Reporter:  cypherpunks                          |          Owner:  nickm
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.2.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.2.4.3-alpha
 Severity:  Normal                               |     Resolution:
 Keywords:  path-selection 029-backport          |  Actual Points:
  030-backport 031-backport                      |
Parent ID:                                       |         Points:  1
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by asn):

 Hmm, fix looks reasonable and obvious here.

 Help me understand one thing: Where does the `tor_llround()` happen after
 `compute_weighted_bandwidths()`? I think the cypherpunks at comment:2 is
 implying that it should be done as part of `final_weight =
 weight*this_bw;`?

 I see `tor_llround()` activity in
 `smartlist_choose_node_by_bandwidth_weights()` using
 `scale_array_elements_to_u64()`.

 However, we don't do it in `frac_nodes_with_descriptors()`. There we just
 use the value as a decimal without rounding. Is that OK?

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


More information about the tor-bugs mailing list