mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Fix smartlist_choose_node_by_bandwidth() so that it rejects ORs with BadExit flag.
This commit is contained in:
parent
2c884fd8cc
commit
f1ebe6bda4
4
changes/bug13066
Normal file
4
changes/bug13066
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
o Minor bugfixes:
|
||||||
|
- Fix node selection logic in smartlist_choose_node_by_bandwidth()
|
||||||
|
so that onion routers with BadExit flag are not considered to be
|
||||||
|
worthy candidates. Fixes issue 13066.
|
@ -3228,6 +3228,14 @@ static const or_circuit_t *CONST_TO_OR_CIRCUIT(const circuit_t *);
|
|||||||
static origin_circuit_t *TO_ORIGIN_CIRCUIT(circuit_t *);
|
static origin_circuit_t *TO_ORIGIN_CIRCUIT(circuit_t *);
|
||||||
static const origin_circuit_t *CONST_TO_ORIGIN_CIRCUIT(const circuit_t *);
|
static const origin_circuit_t *CONST_TO_ORIGIN_CIRCUIT(const circuit_t *);
|
||||||
|
|
||||||
|
/** Return 1 iff <b>node</b> has Exit flag and no BadExit flag.
|
||||||
|
* Otherwise, return 0.
|
||||||
|
*/
|
||||||
|
static INLINE int node_is_good_exit(const node_t *node)
|
||||||
|
{
|
||||||
|
return node->is_exit && ! node->is_bad_exit;
|
||||||
|
}
|
||||||
|
|
||||||
static INLINE or_circuit_t *TO_OR_CIRCUIT(circuit_t *x)
|
static INLINE or_circuit_t *TO_OR_CIRCUIT(circuit_t *x)
|
||||||
{
|
{
|
||||||
tor_assert(x->magic == OR_CIRCUIT_MAGIC);
|
tor_assert(x->magic == OR_CIRCUIT_MAGIC);
|
||||||
|
@ -2202,7 +2202,7 @@ smartlist_choose_node_by_bandwidth(const smartlist_t *sl,
|
|||||||
uint32_t this_bw = 0;
|
uint32_t this_bw = 0;
|
||||||
i = node_sl_idx;
|
i = node_sl_idx;
|
||||||
|
|
||||||
is_exit = node->is_exit;
|
is_exit = node_is_good_exit(node);
|
||||||
is_guard = node->is_possible_guard;
|
is_guard = node->is_possible_guard;
|
||||||
if (node->rs) {
|
if (node->rs) {
|
||||||
if (node->rs->has_bandwidth) {
|
if (node->rs->has_bandwidth) {
|
||||||
|
Loading…
Reference in New Issue
Block a user