[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #2434 [Tor Relay]: Don't disable dirport when accounting limit can't be reached due to bwrate



#2434: Don't disable dirport when accounting limit can't be reached due to bwrate
-----------------------+----------------------------------------------------
 Reporter:  Sebastian  |          Owner:                    
     Type:  defect     |         Status:  needs_review      
 Priority:  normal     |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Relay  |        Version:                    
 Keywords:             |         Parent:                    
   Points:             |   Actualpoints:                    
-----------------------+----------------------------------------------------

Comment(by nickm):

 Looks okay to me too; I concur with roger's first two recommendations, and
 suggest that we defer the third "till later".

 I am not totally comfortable with the new calculation in
 decide_to_advertise_dirport: get_effective_bwrate() returns uint32_t, and
 accounting_get_interval_length returns an int.  On platforms where int is
 32-bit, their product can easily overflow the result type.

 What are our options here?  First option is to use a 64-bit type.  If the
 longest interval we support is a month, then we'll be okay until somebody
 has get_effective_bwrate() returning more than about 6.8 terabytes per
 second.  Second option is to use division, and check whether
 get_effective_bwrate(options) >= options->AccountingMax /
 accounting_get_interval_length().

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2434#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs