diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-15 20:12:20 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-15 20:12:20 -0400 |
commit | 68acfefbdb7a25ac1585c9480a8c98cadca50b7a (patch) | |
tree | 42b6ff228bb1836f2309bef4ff5ef940506badff | |
parent | ced06a80097d2c4f26b1f44447710ec33b9d2421 (diff) | |
parent | bc44393eb59a1d303314b4b646b4d815f4eadc22 (diff) | |
download | tor-68acfefbdb7a25ac1585c9480a8c98cadca50b7a.tar tor-68acfefbdb7a25ac1585c9480a8c98cadca50b7a.tar.gz |
Merge remote-tracking branch 'origin/maint-0.2.2'
-rw-r--r-- | src/common/container.h | 2 | ||||
-rw-r--r-- | src/common/di_ops.h | 1 | ||||
-rw-r--r-- | src/or/config.c | 7 | ||||
-rw-r--r-- | src/or/dirvote.c | 13 | ||||
-rw-r--r-- | src/or/routerlist.c | 9 |
5 files changed, 19 insertions, 13 deletions
diff --git a/src/common/container.h b/src/common/container.h index f5e42de76..4a6eba789 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -261,7 +261,7 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join, * Example use: * SMARTLIST_FOREACH_JOIN(routerstatus_list, routerstatus_t *, rs, * routerinfo_list, routerinfo_t *, ri, - * tor_memcmp(rs->identity_digest, ri->identity_digest, 20), + * tor_memcmp(rs->identity_digest, ri->identity_digest, 20), * log_info(LD_GENERAL,"No match for %s", ri->nickname)) { * log_info(LD_GENERAL, "%s matches routerstatus %p", ri->nickname, rs); * } SMARTLIST_FOREACH_JOIN_END(rs, ri); diff --git a/src/common/di_ops.h b/src/common/di_ops.h index 4a212b0ca..fa7d86806 100644 --- a/src/common/di_ops.h +++ b/src/common/di_ops.h @@ -28,3 +28,4 @@ int tor_memeq(const void *a, const void *b, size_t sz); #define fast_memneq(a,b,c) (0!=memcmp((a),(b),(c))) #endif + diff --git a/src/or/config.c b/src/or/config.c index f675379ad..3a5648319 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1309,9 +1309,10 @@ options_act(or_options_t *old_options) if (revise_trackexithosts) addressmap_clear_excluded_trackexithosts(options); - if (old_options->AutomapHostsOnResolve && !options->AutomapHostsOnResolve) { - revise_automap_entries = 1; - } else if (options->AutomapHostsOnResolve) { + if (!options->AutomapHostsOnResolve) { + if (old_options->AutomapHostsOnResolve) + revise_automap_entries = 1; + } else { if (!smartlist_strings_eq(old_options->AutomapHostsSuffixes, options->AutomapHostsSuffixes)) revise_automap_entries = 1; diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 6fe29f2f4..15174c1dc 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -394,8 +394,9 @@ compare_vote_rs(const vote_routerstatus_t *a, const vote_routerstatus_t *b) if ((r = fast_memcmp(a->status.identity_digest, b->status.identity_digest, DIGEST_LEN))) return r; - if ((r = fast_memcmp(a->status.descriptor_digest, b->status.descriptor_digest, - DIGEST_LEN))) + if ((r = fast_memcmp(a->status.descriptor_digest, + b->status.descriptor_digest, + DIGEST_LEN))) return r; if ((r = (int)(b->status.published_on - a->status.published_on))) return r; @@ -1698,7 +1699,8 @@ networkstatus_compute_consensus(smartlist_t *votes, if (index[v_sl_idx] < size[v_sl_idx]) { rs = smartlist_get(v->routerstatus_list, index[v_sl_idx]); if (!lowest_id || - fast_memcmp(rs->status.identity_digest, lowest_id, DIGEST_LEN) < 0) + fast_memcmp(rs->status.identity_digest, + lowest_id, DIGEST_LEN) < 0) lowest_id = rs->status.identity_digest; } }); @@ -1762,7 +1764,7 @@ networkstatus_compute_consensus(smartlist_t *votes, rs = compute_routerstatus_consensus(matching_descs, consensus_method, microdesc_digest); /* Copy bits of that into rs_out. */ - tor_assert(fast_memeq(lowest_id, rs->status.identity_digest, DIGEST_LEN)); + tor_assert(fast_memeq(lowest_id, rs->status.identity_digest,DIGEST_LEN)); memcpy(rs_out.identity_digest, lowest_id, DIGEST_LEN); memcpy(rs_out.descriptor_digest, rs->status.descriptor_digest, DIGEST_LEN); @@ -2204,7 +2206,8 @@ networkstatus_add_detached_signatures(networkstatus_t *target, } for (alg = DIGEST_SHA1; alg < N_DIGEST_ALGORITHMS; ++alg) { if (!tor_mem_is_zero(digests->d[alg], DIGEST256_LEN)) { - if (fast_memeq(target->digests.d[alg], digests->d[alg], DIGEST256_LEN)) { + if (fast_memeq(target->digests.d[alg], digests->d[alg], + DIGEST256_LEN)) { ++n_matches; } else { *msg_out = "Mismatched digest."; diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 2b383198a..5ce50aa46 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2382,8 +2382,8 @@ router_get_by_nickname(const char *nickname, int warn_if_unnamed) if (n_matches <= 1 || router->is_running) best_match = router; } else if (maybedigest && - tor_memeq(digest, router->cache_info.identity_digest, DIGEST_LEN) - ) { + tor_memeq(digest, router->cache_info.identity_digest, + DIGEST_LEN)) { if (router_hex_digest_matches(router, nickname)) return router; /* If we reach this point, we have a ID=name syntax that matches the @@ -5164,8 +5164,9 @@ routerinfo_incompatible_with_extrainfo(const routerinfo_t *ri, /* The identity must match exactly to have been generated at the same time * by the same router. */ - if (tor_memneq(ri->cache_info.identity_digest, ei->cache_info.identity_digest, - DIGEST_LEN)) { + if (tor_memneq(ri->cache_info.identity_digest, + ei->cache_info.identity_digest, + DIGEST_LEN)) { if (msg) *msg = "Extrainfo nickname or identity did not match routerinfo"; goto err; /* different servers */ } |