diff options
author | Roger Dingledine <arma@torproject.org> | 2020-10-22 03:07:09 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2020-10-22 03:26:03 -0400 |
commit | 00118355f5e6f94352de62f5bb10005cda6f238e (patch) | |
tree | 66d8be81f5b17f0321a94c93d7e6b325ac035239 /src/feature/dirauth | |
parent | ef70f5f42a875c8d1d1280c6ef6f86d01983b6ef (diff) | |
download | tor-00118355f5e6f94352de62f5bb10005cda6f238e.tar.gz tor-00118355f5e6f94352de62f5bb10005cda6f238e.zip |
Turn ConsensusParams into a Linelist
Make it possible to specify multiple ConsensusParams torrc
lines.
Now directory authority operators can for example put the
main ConsensusParams config in one torrc file and then add to it
from a different torrc file.
Closes ticket 40164.
Diffstat (limited to 'src/feature/dirauth')
-rw-r--r-- | src/feature/dirauth/dirauth_options.inc | 2 | ||||
-rw-r--r-- | src/feature/dirauth/dirvote.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/feature/dirauth/dirauth_options.inc b/src/feature/dirauth/dirauth_options.inc index 21f4996c39..2aa07a6c88 100644 --- a/src/feature/dirauth/dirauth_options.inc +++ b/src/feature/dirauth/dirauth_options.inc @@ -46,7 +46,7 @@ CONF_VAR(AuthDirTestEd25519LinkKeys, BOOL, 0, "1") /** Authority only: key=value pairs that we add to our networkstatus * consensus vote on the 'params' line. */ -CONF_VAR(ConsensusParams, STRING, 0, NULL) +CONF_VAR(ConsensusParams, LINELIST, 0, NULL) /** Authority only: minimum number of measured bandwidths we must see * before we only believe measured bandwidths to assign flags. */ diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c index 79651563b4..828ecbc372 100644 --- a/src/feature/dirauth/dirvote.c +++ b/src/feature/dirauth/dirvote.c @@ -4709,9 +4709,12 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, smartlist_sort_strings(v3_out->known_flags); if (d_options->ConsensusParams) { + config_line_t *paramline = d_options->ConsensusParams; v3_out->net_params = smartlist_new(); - smartlist_split_string(v3_out->net_params, - d_options->ConsensusParams, NULL, 0, 0); + for ( ; paramline; paramline = paramline->next) { + smartlist_split_string(v3_out->net_params, + paramline->value, NULL, 0, 0); + } smartlist_sort_strings(v3_out->net_params); } v3_out->bw_file_headers = bw_file_headers; |