[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
Tue Sep 5 02:46:03 UTC 2017


#23318: compute_weighted_bandwidths: do not add 0.5 to final_weight
----------------------------+------------------------------------
 Reporter:  cypherpunks     |          Owner:  (none)
     Type:  defect          |         Status:  new
 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  |  Actual Points:
Parent ID:                  |         Points:  1
 Reviewer:                  |        Sponsor:
----------------------------+------------------------------------
Changes (by teor):

 * priority:  Very High => Medium
 * points:   => 1
 * version:   => Tor: 0.2.4.3-alpha


Comment:

 Replying to [comment:2 cypherpunks]:
 > I think in original code 0.5 contradicts to tor_llround(), it should be
 (int64_t)(weight*this_bw + 0.5) or tor_llround(weight*this_bw)

 I can confirm this bug: `tor_llround(weight*this_bw + 0.5)` returns 1 when
 weight or this_bw are 0, because tor_llround() rounds away from zero. This
 is probably not what we want.

 I split the other bug off into another ticket.

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


More information about the tor-bugs mailing list