|
@@ -254,6 +254,8 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
|
|
|
/* XXXX Abstraction violation: should be pulling a field out of v3_ns.*/
|
|
|
char *flag_thresholds = dirserv_get_flag_thresholds_line();
|
|
|
char *params;
|
|
|
+ char *bwlist_headers = smartlist_join_strings(v3_ns->bwlist_headers,
|
|
|
+ " ", 0, NULL);
|
|
|
authority_cert_t *cert = v3_ns->cert;
|
|
|
char *methods =
|
|
|
make_consensus_method_list(MIN_SUPPORTED_CONSENSUS_METHOD,
|
|
@@ -267,7 +269,6 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
|
|
|
params = smartlist_join_strings(v3_ns->net_params, " ", 0, NULL);
|
|
|
else
|
|
|
params = tor_strdup("");
|
|
|
-
|
|
|
tor_assert(cert);
|
|
|
smartlist_add_asprintf(chunks,
|
|
|
"network-status-version 3\n"
|
|
@@ -286,7 +287,8 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
|
|
|
"params %s\n"
|
|
|
"dir-source %s %s %s %s %d %d\n"
|
|
|
"contact %s\n"
|
|
|
- "%s", /* shared randomness information */
|
|
|
+ "%s" /* shared randomness information */
|
|
|
+ "bandwidth-file %s\n", /* bandwidth file headers */
|
|
|
v3_ns->type == NS_TYPE_VOTE ? "vote" : "opinion",
|
|
|
methods,
|
|
|
published, va, fu, vu,
|
|
@@ -302,13 +304,15 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
|
|
|
fmt_addr32(addr), voter->dir_port, voter->or_port,
|
|
|
voter->contact,
|
|
|
shared_random_vote_str ?
|
|
|
- shared_random_vote_str : "");
|
|
|
+ shared_random_vote_str : "",
|
|
|
+ bwlist_headers);
|
|
|
|
|
|
tor_free(params);
|
|
|
tor_free(flags);
|
|
|
tor_free(flag_thresholds);
|
|
|
tor_free(methods);
|
|
|
tor_free(shared_random_vote_str);
|
|
|
+ tor_free(bwlist_headers);
|
|
|
|
|
|
if (!tor_digest_is_zero(voter->legacy_id_digest)) {
|
|
|
char fpbuf[HEX_DIGEST_LEN+1];
|
|
@@ -4291,7 +4295,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
|
|
|
uint32_t addr;
|
|
|
char *hostname = NULL, *client_versions = NULL, *server_versions = NULL;
|
|
|
const char *contact;
|
|
|
- smartlist_t *routers, *routerstatuses;
|
|
|
+ smartlist_t *routers, *routerstatuses, *bwlist_headers;
|
|
|
char identity_digest[DIGEST_LEN];
|
|
|
char signing_key_digest[DIGEST_LEN];
|
|
|
int listbadexits = options->AuthDirListBadExits;
|
|
@@ -4338,7 +4342,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
|
|
|
* set_routerstatus_from_routerinfo() see up-to-date bandwidth info.
|
|
|
*/
|
|
|
if (options->V3BandwidthsFile) {
|
|
|
- dirserv_read_measured_bandwidths(options->V3BandwidthsFile, NULL);
|
|
|
+ dirserv_read_measured_bandwidths(options->V3BandwidthsFile, NULL, NULL);
|
|
|
} else {
|
|
|
/*
|
|
|
* No bandwidths file; clear the measured bandwidth cache in case we had
|
|
@@ -4375,6 +4379,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
|
|
|
|
|
|
routerstatuses = smartlist_new();
|
|
|
microdescriptors = smartlist_new();
|
|
|
+ bwlist_headers = smartlist_new();
|
|
|
|
|
|
SMARTLIST_FOREACH_BEGIN(routers, routerinfo_t *, ri) {
|
|
|
/* If it has a protover list and contains a protocol name greater than
|
|
@@ -4441,7 +4446,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
|
|
|
/* This pass through applies the measured bw lines to the routerstatuses */
|
|
|
if (options->V3BandwidthsFile) {
|
|
|
dirserv_read_measured_bandwidths(options->V3BandwidthsFile,
|
|
|
- routerstatuses);
|
|
|
+ routerstatuses, bwlist_headers);
|
|
|
} else {
|
|
|
/*
|
|
|
* No bandwidths file; clear the measured bandwidth cache in case we had
|
|
@@ -4537,6 +4542,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
|
|
|
options->ConsensusParams, NULL, 0, 0);
|
|
|
smartlist_sort_strings(v3_out->net_params);
|
|
|
}
|
|
|
+ v3_out->bwlist_headers = bwlist_headers;
|
|
|
|
|
|
voter = tor_malloc_zero(sizeof(networkstatus_voter_info_t));
|
|
|
voter->nickname = tor_strdup(options->Nickname);
|