summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 881fc9301e..24ec0e90c3 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -877,8 +877,13 @@ router_rebuild_descriptor(int force)
ri->bandwidthburst = (int)options->BandwidthBurst;
ri->bandwidthcapacity = hibernating ? 0 : rep_hist_bandwidth_assess();
- if (options->BandwidthRate > options->MaxAdvertisedBandwidth)
- ri->bandwidthrate = (int)options->MaxAdvertisedBandwidth;
+ if (options->BandwidthRate > options->MaxAdvertisedBandwidth) {
+ if (options->MaxAdvertisedBandwidth > ROUTER_MAX_DECLARED_BANDWIDTH) {
+ ri->bandwidthrate = ROUTER_MAX_DECLARED_BANDWIDTH;
+ } else {
+ ri->bandwidthrate = (int)options->MaxAdvertisedBandwidth;
+ }
+ }
policies_parse_exit_policy(options->ExitPolicy, &ri->exit_policy,
options->ExitPolicyRejectPrivate);