From dae5fc798271db3b993be1b38cfada73e05dab68 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 28 Feb 2007 16:56:07 +0000 Subject: r11981@catbus: nickm | 2007-02-28 11:55:27 -0500 Clamp declarable bandwidth at INT32_MAX, not INT_MAX. svn:r9677 --- src/or/router.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/or/router.c') 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); -- cgit v1.2.3-54-g00ecf