diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-08-25 14:55:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-09-26 10:56:51 -0700 |
commit | f33b90324abe11724f59389e1aeaf8b3e021c3af (patch) | |
tree | 62090b34128900b39ca03672f33702cb6f4146b6 /src/or/dirserv.c | |
parent | d97a3855350aacd1ea776506624171952fab8ed8 (diff) | |
download | tor-f33b90324abe11724f59389e1aeaf8b3e021c3af.tar.gz tor-f33b90324abe11724f59389e1aeaf8b3e021c3af.zip |
Include protocol versions in votes.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index a4eb738a30..03b05ac5d1 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -24,6 +24,7 @@ #include "networkstatus.h" #include "nodelist.h" #include "policies.h" +#include "protover.h" #include "rephist.h" #include "router.h" #include "routerlist.h" @@ -1795,6 +1796,7 @@ version_from_platform(const char *platform) */ char * routerstatus_format_entry(const routerstatus_t *rs, const char *version, + const char *protocols, routerstatus_format_type_t format, const vote_routerstatus_t *vrs) { @@ -1858,6 +1860,9 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version, if (version && strlen(version) < MAX_V_LINE_LEN - V_LINE_OVERHEAD) { smartlist_add_asprintf(chunks, "v %s\n", version); } + if (protocols) { + smartlist_add_asprintf(chunks, "proto %s\n", protocols); + } if (format != NS_V2) { const routerinfo_t* desc = router_get_by_id_digest(rs->identity_digest); @@ -2836,6 +2841,12 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, rs->is_flagged_running = 0; vrs->version = version_from_platform(ri->platform); + if (ri->protocol_list) { + vrs->protocols = tor_strdup(ri->protocol_list); + } else { + vrs->protocols = tor_strdup( + protover_compute_for_old_tor(vrs->version)); + } vrs->microdesc = dirvote_format_all_microdesc_vote_lines(ri, now, microdescriptors); |