Restrict PerConnBWRate|Burst to INT32_MAX, update manpage

All other bandwidthrate settings are restricted to INT32_MAX, but
this check was forgotten for PerConnBWRate and PerConnBWBurst. Also
update the manpage to reflect the fact that specifying a bandwidth
in terabytes does not make sense, because that value will be too
large.
This commit is contained in:
Sebastian Hahn 2010-02-25 12:25:57 +01:00
parent c8f154e173
commit 2917c0596c
3 changed files with 15 additions and 7 deletions

View File

@ -5,6 +5,8 @@ Changes in version 0.2.2.10-alpha - 2010-??-??
- Fix a dereference-then-NULL-check sequence when publishing
descriptors. Bugfix on tor-0.2.1.5-alpha. Discovered by ekir,
fixes bug 1255.
- Disallow values larger than INT32_MAX for PerConnBWRate|Burst
config option. Bugfix on 0.2.2.7-alpha.
Changes in version 0.2.2.9-alpha - 2010-02-22
o Directory authority changes:

View File

@ -66,40 +66,40 @@ Other options can be specified either on the command-line (--option
Options are case-insensitive. C-style escaped characters are allowed inside
quoted values.
**BandwidthRate** __N__ **bytes**|**KB**|**MB**|**GB**|**TB**::
**BandwidthRate** __N__ **bytes**|**KB**|**MB**|**GB**::
A token bucket limits the average incoming bandwidth usage on this node to
the specified number of bytes per second, and the average outgoing
bandwidth usage to that same value. (Default: 5 MB)
**BandwidthBurst** __N__ **bytes**|**KB**|**MB**|**GB**|**TB**::
**BandwidthBurst** __N__ **bytes**|**KB**|**MB**|**GB**::
Limit the maximum token bucket size (also known as the burst) to the given
number of bytes in each direction. (Default: 10 MB)
**MaxAdvertisedBandwidth** __N__ **bytes**|**KB**|**MB**|**GB**|**TB**::
**MaxAdvertisedBandwidth** __N__ **bytes**|**KB**|**MB**|**GB**::
If set, we will not advertise more than this amount of bandwidth for our
BandwidthRate. Server operators who want to reduce the number of clients
who ask to build circuits through them (since this is proportional to
advertised bandwidth rate) can thus reduce the CPU demands on their server
without impacting network performance.
**RelayBandwidthRate** __N__ **bytes**|**KB**|**MB**|**GB**|**TB**::
**RelayBandwidthRate** __N__ **bytes**|**KB**|**MB**|**GB**::
If defined, a separate token bucket limits the average incoming bandwidth
usage for \_relayed traffic_ on this node to the specified number of bytes
per second, and the average outgoing bandwidth usage to that same value.
Relayed traffic currently is calculated to include answers to directory
requests, but that may change in future versions. (Default: 0)
**RelayBandwidthBurst** __N__ **bytes**|**KB**|**MB**|**GB**|**TB**::
**RelayBandwidthBurst** __N__ **bytes**|**KB**|**MB**|**GB**::
Limit the maximum token bucket size (also known as the burst) for
\_relayed traffic_ to the given number of bytes in each direction.
(Default: 0)
**PerConnBWRate** __N__ **bytes**|**KB**|**MB**|**GB**|**TB**::
**PerConnBWRate** __N__ **bytes**|**KB**|**MB**|**GB**::
If set, do separate rate limiting for each connection from a non-relay.
You should never need to change this value, since a network-wide value is
published in the consensus and your relay will use that value. (Default: 0)
**PerConnBWBurst** __N__ **bytes**|**KB**|**MB**|**GB**|**TB**::
**PerConnBWBurst** __N__ **bytes**|**KB**|**MB**|**GB**::
If set, do separate rate limiting for each connection from a non-relay.
You should never need to change this value, since a network-wide value is
published in the consensus and your relay will use that value. (Default: 0)

View File

@ -3228,6 +3228,12 @@ options_validate(or_options_t *old_options, or_options_t *options,
if (ensure_bandwidth_cap(&options->RelayBandwidthBurst,
"RelayBandwidthBurst", msg) < 0)
return -1;
if (ensure_bandwidth_cap(&options->PerConnBWRate,
"PerConnBWRate", msg) < 0)
return -1;
if (ensure_bandwidth_cap(&options->PerConnBWBurst,
"PerConnBWBurst", msg) < 0)
return -1;
if (server_mode(options)) {
if (options->BandwidthRate < ROUTER_REQUIRED_MIN_BANDWIDTH) {