Merge branch 'maint-0.2.4' into release-0.2.4

This commit is contained in:
Roger Dingledine 2013-07-18 23:36:05 -04:00
commit bc6c7ea74e
9 changed files with 1456 additions and 784 deletions

5
changes/bug9200 Normal file
View File

@ -0,0 +1,5 @@
o Major bugfixes:
- Fix a bug in the voting algorithm that could yield incorrect results
when a non-naming authority declared too many flags. Fixes bug 9200;
bugfix on 0.2.0.3-alpha.

4
changes/bug9254 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- Fix a spurious compilation warning with some older versions of
GCC on FreeBSD. Fixes bug 9254; bugfix on 0.2.4.14-alpha.

4
changes/bug9295 Normal file
View File

@ -0,0 +1,4 @@
o Major bugfixes:
- Avoid a crash when using --hash-password. Fixes bug 9295; bugfix on
0.2.4.15-rc. Found by stem integration tests.

3
changes/geoip-july2013 Normal file
View File

@ -0,0 +1,3 @@
o Minor features:
- Update to the July 3 2013 Maxmind GeoLite Country database.

View File

@ -1669,7 +1669,7 @@ is non-zero):
If it hits this threshold, it will begin killing circuits until it
has recovered at least 10% of this memory. Do not set this option too
low, or your relay may be unreliable under load. This option only
effects circuit queues, so the actual process size will be larger than
affects circuit queues, so the actual process size will be larger than
this. (Default: 8GB)
DIRECTORY SERVER OPTIONS

File diff suppressed because it is too large Load Diff

View File

@ -1518,8 +1518,10 @@ static size_t
n_cells_in_circ_queues(const circuit_t *c)
{
size_t n = c->n_chan_cells.n;
if (! CIRCUIT_IS_ORIGIN(c))
n += TO_OR_CIRCUIT((circuit_t*)c)->p_chan_cells.n;
if (! CIRCUIT_IS_ORIGIN(c)) {
circuit_t *cc = (circuit_t *) c;
n += TO_OR_CIRCUIT(cc)->p_chan_cells.n;
}
return n;
}

View File

@ -3714,6 +3714,7 @@ options_init_from_torrc(int argc, char **argv)
}
if (command == CMD_HASH_PASSWORD) {
cf_defaults = tor_strdup("");
cf = tor_strdup("");
} else {
cf_defaults = load_torrc_from_disk(argc, argv, 1);

View File

@ -1590,10 +1590,19 @@ networkstatus_compute_consensus(smartlist_t *votes,
unnamed_flag[i] = named_flag[i] = -1;
chosen_named_idx = smartlist_string_pos(flags, "Named");
/* Build the flag index. */
/* Build the flag indexes. Note that no vote can have more than 64 members
* for known_flags, so no value will be greater than 63, so it's safe to
* do U64_LITERAL(1) << index on these values. But note also that
* named_flag and unnamed_flag are initialized to -1, so we need to check
* that they're actually set before doing U64_LITERAL(1) << index with
* them.*/
SMARTLIST_FOREACH_BEGIN(votes, networkstatus_t *, v) {
flag_map[v_sl_idx] = tor_malloc_zero(
sizeof(int)*smartlist_len(v->known_flags));
if (smartlist_len(v->known_flags) > MAX_KNOWN_FLAGS_IN_VOTE) {
log_warn(LD_BUG, "Somehow, a vote has %d entries in known_flags",
smartlist_len(v->known_flags));
}
SMARTLIST_FOREACH_BEGIN(v->known_flags, const char *, fl) {
int p = smartlist_string_pos(flags, fl);
tor_assert(p >= 0);
@ -1727,7 +1736,8 @@ networkstatus_compute_consensus(smartlist_t *votes,
if (rs->flags & (U64_LITERAL(1) << i))
++flag_counts[flag_map[v_sl_idx][i]];
}
if (rs->flags & (U64_LITERAL(1) << named_flag[v_sl_idx])) {
if (named_flag[v_sl_idx] >= 0 &&
(rs->flags & (U64_LITERAL(1) << named_flag[v_sl_idx]))) {
if (chosen_name && strcmp(chosen_name, rs->status.nickname)) {
log_notice(LD_DIR, "Conflict on naming for router: %s vs %s",
chosen_name, rs->status.nickname);