]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
if a router claim huge bandwidth, don't believe it
authorRoger Dingledine <arma@torproject.org>
Tue, 17 Aug 2004 02:00:36 +0000 (02:00 +0000)
committerRoger Dingledine <arma@torproject.org>
Tue, 17 Aug 2004 02:00:36 +0000 (02:00 +0000)
svn:r2245

src/or/config.c
src/or/routerlist.c

index e87a02454ecb13967b0eff822eebc03ac4df7dcc..0bf510acc974aafd8b176f5ca4c7d8ece87abb5d 100644 (file)
@@ -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)
index b745736079cadad4683d9e2e2fa0f142c8255d5f..02e4b1836bfb9cfcd2167e308417028f0bb61237 100644 (file)
@@ -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);