commit 41eef6680e814f453cc8eedff415e941429aa627 Merge: c6ea014 dfa6cde Author: Nick Mathewson nickm@torproject.org Date: Wed Sep 7 14:51:55 2011 -0400
Merge remote-tracking branch 'origin/maint-0.2.2'
Conflicts: src/or/dirserv.c src/or/networkstatus.c
Conflicts were related to routerinfo->node shift.
changes/bug2649a | 5 +++++ changes/bug2649b | 5 +++++ doc/tor.1.txt | 7 ++++++- src/or/config.c | 3 ++- src/or/dirserv.c | 17 ++++++++++++----- src/or/dirvote.h | 2 +- src/or/networkstatus.c | 2 +- src/or/or.h | 3 +++ 8 files changed, 35 insertions(+), 9 deletions(-)
diff --cc src/or/dirserv.c index 0ea1ef6,6607901..d22a053 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@@ -2297,11 -2260,9 +2297,11 @@@ get_possible_sybil_list(const smartlist */ void set_routerstatus_from_routerinfo(routerstatus_t *rs, - routerinfo_t *ri, time_t now, + node_t *node, + routerinfo_t *ri, + time_t now, int naming, int listbadexits, - int listbaddirs) + int listbaddirs, int vote_on_hsdirs) { int unstable_version = !tor_version_as_new_as(ri->platform,"0.1.1.16-rc-cvs"); @@@ -2340,10 -2303,10 +2340,11 @@@ } else { rs->is_possible_guard = 0; } - rs->is_bad_directory = listbaddirs && ri->is_bad_directory; - rs->is_bad_exit = listbadexits && ri->is_bad_exit; - ri->is_hs_dir = dirserv_thinks_router_is_hs_dir(ri, now); - rs->is_hs_dir = vote_on_hsdirs && ri->is_hs_dir; ++ + rs->is_bad_directory = listbaddirs && node->is_bad_directory; + rs->is_bad_exit = listbadexits && node->is_bad_exit; + node->is_hs_dir = dirserv_thinks_router_is_hs_dir(ri, node, now); - rs->is_hs_dir = node->is_hs_dir; ++ rs->is_hs_dir = vote_on_hsdirs && node->is_hs_dir; rs->is_v2_dir = ri->dir_port != 0;
if (!strcasecmp(ri->nickname, UNNAMED_ROUTER_NICKNAME)) @@@ -2628,8 -2601,9 +2630,9 @@@ dirserv_generate_networkstatus_vote_obj
vrs = tor_malloc_zero(sizeof(vote_routerstatus_t)); rs = &vrs->status; - set_routerstatus_from_routerinfo(rs, ri, now, + set_routerstatus_from_routerinfo(rs, node, ri, now, - naming, listbadexits, listbaddirs); + naming, listbadexits, listbaddirs, + vote_on_hsdirs);
if (digestmap_get(omit_as_sybil, ri->cache_info.identity_digest)) clear_status_flags_on_sybil(rs); @@@ -2868,13 -2849,10 +2874,14 @@@ generate_v2_networkstatus_opinion(void if (ri->cache_info.published_on >= cutoff) { routerstatus_t rs; char *version = version_from_platform(ri->platform); - - set_routerstatus_from_routerinfo(&rs, ri, now, + node_t *node = node_get_mutable_by_id(ri->cache_info.identity_digest); + if (!node) { + tor_free(version); + continue; + } + set_routerstatus_from_routerinfo(&rs, node, ri, now, - naming, listbadexits, listbaddirs); + naming, listbadexits, listbaddirs, + vote_on_hsdirs);
if (digestmap_get(omit_as_sybil, ri->cache_info.identity_digest)) clear_status_flags_on_sybil(&rs); diff --cc src/or/dirvote.h index b6746c6,de11fcf..d196351 --- a/src/or/dirvote.h +++ b/src/or/dirvote.h @@@ -60,10 -60,9 +60,10 @@@ const char *dirvote_get_pending_detache #define DGV_INCLUDE_PREVIOUS 4 const cached_dir_t *dirvote_get_vote(const char *fp, int flags); void set_routerstatus_from_routerinfo(routerstatus_t *rs, + node_t *node, routerinfo_t *ri, time_t now, int naming, int listbadexits, - int listbaddirs); + int listbaddirs, int vote_on_hsdirs); void router_clear_status_flags(routerinfo_t *ri); networkstatus_t * dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key, diff --cc src/or/networkstatus.c index 398f041,b0ef74b..7cd9d02 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@@ -2133,7 -2105,7 +2133,7 @@@ networkstatus_getinfo_by_purpose(const if (bridge_auth && ri->purpose == ROUTER_PURPOSE_BRIDGE) dirserv_set_router_is_running(ri, now); /* then generate and write out status lines for each of them */ - set_routerstatus_from_routerinfo(&rs, node, ri, now, 0, 0, 0); - set_routerstatus_from_routerinfo(&rs, ri, now, 0, 0, 0, 0); ++ set_routerstatus_from_routerinfo(&rs, node, ri, now, 0, 0, 0, 0); smartlist_add(statuses, networkstatus_getinfo_helper_single(&rs)); });
tor-commits@lists.torproject.org