summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-10-01 17:22:04 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-01 18:14:28 -0400
commit42acef68ad6fbe462a00815fbccf94c817931e8f (patch)
treec86552540c7691fd7f2c5b0bc22f24fc244c17d4
parentb5341314c17573db15a7cc5999f36569c764c462 (diff)
downloadtor-42acef68ad6fbe462a00815fbccf94c817931e8f.tar.gz
tor-42acef68ad6fbe462a00815fbccf94c817931e8f.zip
Fix a bug in smartlist_choose_node_by_bandwidth
-rw-r--r--src/or/routerlist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 73657fca65..05ecbe32b4 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1878,7 +1878,7 @@ static const node_t *
smartlist_choose_node_by_bandwidth(smartlist_t *sl,
bandwidth_weight_rule_t rule)
{
- unsigned int i;
+ unsigned i;
const routerstatus_t *status=NULL;
int32_t *bandwidths;
int is_exit;
@@ -1925,6 +1925,7 @@ smartlist_choose_node_by_bandwidth(smartlist_t *sl,
int is_known = 1;
int32_t flags = 0;
uint32_t this_bw = 0;
+ i = node_sl_idx;
if (router_digest_is_me(node->identity))
me_idx = node_sl_idx;