summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-17 02:00:36 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-17 02:00:36 +0000
commit76eadc6f0ad74985e8977e0c1968ef41533a341b (patch)
tree91846753677ab482cc14b65e473dde4046dbd12a /src
parent0b91fd1cbe07a057cc3129d9bfe3bae0d3c703e6 (diff)
downloadtor-76eadc6f0ad74985e8977e0c1968ef41533a341b.tar.gz
tor-76eadc6f0ad74985e8977e0c1968ef41533a341b.zip
if a router claim huge bandwidth, don't believe it
svn:r2245
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c2
-rw-r--r--src/or/routerlist.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index e87a02454e..0bf510acc9 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -130,7 +130,7 @@ static void config_free_lines(struct config_line_t *front) {
/**
* Given a list of comma-separated entries, each surrounded by optional
- * whitespace, insert copies the entries (in order) into lst, without
+ * whitespace, insert copies of the entries (in order) into lst, without
* their surrounding whitespace.
*/
static void parse_csv_into_smartlist(smartlist_t *lst, const char *val)
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index b745736079..02e4b1836b 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -250,6 +250,8 @@ routerlist_sl_choose_by_bandwidth(smartlist_t *sl)
/* give capacity a default, until 0.0.7 is obsolete */
tmp = (router->bandwidthcapacity == 0) ? 200000 : router->bandwidthcapacity;
this_bw = (tmp < router->bandwidthrate) ? tmp : router->bandwidthrate;
+ if(this_bw > 800000)
+ this_bw = 800000; /* if they claim something huge, don't believe it */
p = tor_malloc(sizeof(uint32_t));
*p = this_bw;
smartlist_add(bandwidths, p);