mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Merge branch 'bug2203_rebased' into maint-0.2.2
This commit is contained in:
commit
e9803aa710
6
changes/bug2203
Normal file
6
changes/bug2203
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
o Minor bugfixes:
|
||||||
|
- Clients should not weight BadExit nodes as Exits in their node
|
||||||
|
selection. Similarly, directory authorities should not count
|
||||||
|
BadExit bandwidth as Exit bandwidth when computing bandwidth-weights.
|
||||||
|
Bugfix on 0.2.2.10-alpha; fixes bug 2203.
|
||||||
|
|
@ -1618,6 +1618,11 @@
|
|||||||
* If consensus-method 7 or later is in use, the params line is
|
* If consensus-method 7 or later is in use, the params line is
|
||||||
included in the output.
|
included in the output.
|
||||||
|
|
||||||
|
* If the consensus method is under 11, bad exits are considered as
|
||||||
|
possible exits when computing bandwidth weights. Otherwise, if
|
||||||
|
method 11 or later is in use, any router that is determined to get
|
||||||
|
the BadExit flag doesn't count when we're calculating weights.
|
||||||
|
|
||||||
The signatures at the end of a consensus document are sorted in
|
The signatures at the end of a consensus document are sorted in
|
||||||
ascending order by identity digest.
|
ascending order by identity digest.
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ static int dirvote_publish_consensus(void);
|
|||||||
static char *make_consensus_method_list(int low, int high, const char *sep);
|
static char *make_consensus_method_list(int low, int high, const char *sep);
|
||||||
|
|
||||||
/** The highest consensus method that we currently support. */
|
/** 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 */
|
/** Lowest consensus method that contains a 'directory-footer' marker */
|
||||||
#define MIN_METHOD_FOR_FOOTER 9
|
#define MIN_METHOD_FOR_FOOTER 9
|
||||||
@ -1693,7 +1693,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
|||||||
const char *chosen_name = NULL;
|
const char *chosen_name = NULL;
|
||||||
int exitsummary_disagreement = 0;
|
int exitsummary_disagreement = 0;
|
||||||
int is_named = 0, is_unnamed = 0, is_running = 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 naming_conflict = 0;
|
||||||
int n_listing = 0;
|
int n_listing = 0;
|
||||||
int i;
|
int i;
|
||||||
@ -1819,6 +1819,8 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
|||||||
is_guard = 1;
|
is_guard = 1;
|
||||||
else if (!strcmp(fl, "Running"))
|
else if (!strcmp(fl, "Running"))
|
||||||
is_running = 1;
|
is_running = 1;
|
||||||
|
else if (!strcmp(fl, "BadExit"))
|
||||||
|
is_bad_exit = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1845,6 +1847,11 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
|||||||
rs_out.bandwidth = median_uint32(bandwidths, num_bandwidths);
|
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 (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS) {
|
||||||
if (rs_out.has_bandwidth) {
|
if (rs_out.has_bandwidth) {
|
||||||
T += rs_out.bandwidth;
|
T += rs_out.bandwidth;
|
||||||
|
@ -1722,7 +1722,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl,
|
|||||||
double weight = 1;
|
double weight = 1;
|
||||||
if (statuses) {
|
if (statuses) {
|
||||||
routerstatus_t *status = smartlist_get(sl, i);
|
routerstatus_t *status = smartlist_get(sl, i);
|
||||||
is_exit = status->is_exit;
|
is_exit = status->is_exit && !status->is_bad_exit;
|
||||||
is_guard = status->is_possible_guard;
|
is_guard = status->is_possible_guard;
|
||||||
is_dir = (status->dir_port != 0);
|
is_dir = (status->dir_port != 0);
|
||||||
if (!status->has_bandwidth) {
|
if (!status->has_bandwidth) {
|
||||||
@ -1742,7 +1742,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl,
|
|||||||
routerinfo_t *router = smartlist_get(sl, i);
|
routerinfo_t *router = smartlist_get(sl, i);
|
||||||
rs = router_get_consensus_status_by_id(
|
rs = router_get_consensus_status_by_id(
|
||||||
router->cache_info.identity_digest);
|
router->cache_info.identity_digest);
|
||||||
is_exit = router->is_exit;
|
is_exit = router->is_exit && !router->is_bad_exit;
|
||||||
is_guard = router->is_possible_guard;
|
is_guard = router->is_possible_guard;
|
||||||
is_dir = (router->dir_port != 0);
|
is_dir = (router->dir_port != 0);
|
||||||
if (rs && rs->has_bandwidth) {
|
if (rs && rs->has_bandwidth) {
|
||||||
|
Loading…
Reference in New Issue
Block a user