Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#2470 closed defect (fixed)

Relaybandwidthburst but no relaybandwidthrate = use too much bandwidth

Reported by: arma Owned by:
Priority: High Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


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.

Child Tickets

Change History (7)

comment:1 Changed 9 years ago by arma

This bug is also biting:

router lastCookie 9124 0 9034
bandwidth 5242880 2560000 3531633
router PeRu 9001 0 0
bandwidth 5242880 71680 142429

and could be biting (but isn't yet)

router alpaca 9001 0 0
bandwidth 10485760 1048576 52848
router TORnaDO 9001 0 9030
bandwidth 5242880 204800 205757

comment:2 Changed 9 years ago by arma

Status: newneeds_review

bug2470 in my arma fixes this.

comment:3 Changed 9 years ago by nickm

Looks ok to me; I say go ahead and merge.

comment:4 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Or I can go ahead and merge it myself. One more bug down.

comment:5 Changed 7 years ago by nickm

Keywords: tor-relay added

comment:6 Changed 7 years ago by nickm

Component: Tor RelayTor

comment:7 Changed 7 years ago by nickm

Milestone: Tor: 0.2.1.x-final

Milestone Tor: 0.2.1.x-final deleted

Note: See TracTickets for help on using tickets.