diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-02-04 12:26:59 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-02-04 12:26:59 -0500 |
commit | 69f7c0385b16acdfa4a38cb36c86aaceebf61301 (patch) | |
tree | e252207389dbc10af5937a7bca14a26943962510 /src/or/dirvote.c | |
parent | a6c811313af3cfda1fca1d7595e9259f51d6ffd0 (diff) | |
parent | e9803aa71003079cc00a8b3c80324581758a36be (diff) | |
download | tor-69f7c0385b16acdfa4a38cb36c86aaceebf61301.tar.gz tor-69f7c0385b16acdfa4a38cb36c86aaceebf61301.zip |
Merge remote branch 'origin/maint-0.2.2' for bug2203_rebased
There was a merge conflict in routerlist.c due to the new node_t logic.
Conflicts:
src/or/routerlist.c
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 8ef5b14a4f..1052da93c8 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -50,7 +50,7 @@ static int dirvote_publish_consensus(void); static char *make_consensus_method_list(int low, int high, const char *sep); /** The highest consensus method that we currently support. */ -#define MAX_SUPPORTED_CONSENSUS_METHOD 10 +#define MAX_SUPPORTED_CONSENSUS_METHOD 11 /** Lowest consensus method that contains a 'directory-footer' marker */ #define MIN_METHOD_FOR_FOOTER 9 @@ -1686,7 +1686,7 @@ networkstatus_compute_consensus(smartlist_t *votes, const char *chosen_name = NULL; int exitsummary_disagreement = 0; int is_named = 0, is_unnamed = 0, is_running = 0; - int is_guard = 0, is_exit = 0; + int is_guard = 0, is_exit = 0, is_bad_exit = 0; int naming_conflict = 0; int n_listing = 0; int i; @@ -1812,6 +1812,8 @@ networkstatus_compute_consensus(smartlist_t *votes, is_guard = 1; else if (!strcmp(fl, "Running")) is_running = 1; + else if (!strcmp(fl, "BadExit")) + is_bad_exit = 1; } } }); @@ -1838,6 +1840,11 @@ networkstatus_compute_consensus(smartlist_t *votes, rs_out.bandwidth = median_uint32(bandwidths, num_bandwidths); } + /* Fix bug 2203: Do not count BadExit nodes as Exits for bw weights */ + if (consensus_method >= 11) { + is_exit = is_exit && !is_bad_exit; + } + if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS) { if (rs_out.has_bandwidth) { T += rs_out.bandwidth; |