[tor-bugs] #2470 [Tor Relay]: Relaybandwidthburst but no relaybandwidthrate = use too much bandwidth

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Tue Feb 1 04:30:46 UTC 2011


#2470: Relaybandwidthburst but no relaybandwidthrate = use too much bandwidth
-----------------------+----------------------------------------------------
 Reporter:  arma       |       Owner:                    
     Type:  defect     |      Status:  new               
 Priority:  major      |   Milestone:  Tor: 0.2.1.x-final
Component:  Tor Relay  |     Version:                    
 Keywords:             |      Points:                    
   Parent:             |  
-----------------------+----------------------------------------------------
 If you set
 {{{
 RelayBandwidthBurst 2000 Kbytes
 }}}
 but don't set !RelayBandwidthRate, you'll end up with a bandwidth line
 like !LetoAms's:
 {{{
 bandwidth 5242880 2048000 5429489
 }}}

 It turns out we're ignoring !RelayBandwidthBurst if you didn't also set
 !RelayBandwidthRate. See this clause from connection_bucket_refill():
 {{{
   if (options->RelayBandwidthRate) {
     relayrate = (int)options->RelayBandwidthRate;
     relayburst = (int)options->RelayBandwidthBurst;
   } else {
     relayrate = (int)options->BandwidthRate;
     relayburst = (int)options->BandwidthBurst;
   }
 }}}

 It's kind of an edge case, but we should still fix it. The fix should
 either be to fail to start if !RelayBandwidthBurst is non-zero but
 !RelayBandwidthRate is 0, or to set !RelayBandwidthRate to
 !RelayBandwidthBurst in that case and continue.

 The latter choice is probably better. But notice that we do the former
 (complain and fail to start) if you set !BandwidthBurst to 2MB but leave
 !BandwidthRate alone (so it defaults to 5MB/s).

 Reported by Paul Wouters.

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


More information about the tor-bugs mailing list