[tor-commits] [tor/master] Move ConsensusParams to dirauth module.

nickm at torproject.org nickm at torproject.org
Fri Jan 17 13:37:45 UTC 2020


commit 0c7fd8312341b349f93e97c915234b18d0d014ca
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Dec 19 09:46:14 2019 -0500

    Move ConsensusParams to dirauth module.
---
 src/app/config/config.c                 | 1 -
 src/app/config/or_options_st.h          | 4 ----
 src/feature/dirauth/dirauth_options.inc | 4 ++++
 src/feature/dirauth/dirvote.c           | 4 ++--
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/app/config/config.c b/src/app/config/config.c
index 4b47894cc..65a0733e0 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -371,7 +371,6 @@ static const config_var_t option_vars_[] = {
   V(ClientTransportPlugin,       LINELIST, NULL),
   V(ClientUseIPv6,               BOOL,     "0"),
   V(ClientUseIPv4,               BOOL,     "1"),
-  V(ConsensusParams,             STRING,   NULL),
   V(ConnLimit,                   POSINT,     "1000"),
   V(ConnDirectionStatistics,     BOOL,     "0"),
   V(ConstrainedSockets,          BOOL,     "0"),
diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h
index 09edc21a7..eaa32f9bf 100644
--- a/src/app/config/or_options_st.h
+++ b/src/app/config/or_options_st.h
@@ -670,10 +670,6 @@ struct or_options_t {
   /** Location of guardfraction file */
   char *GuardfractionFile;
 
-  /** Authority only: key=value pairs that we add to our networkstatus
-   * consensus vote on the 'params' line. */
-  char *ConsensusParams;
-
   /** Authority only: minimum number of measured bandwidths we must see
    * before we only believe measured bandwidths to assign flags. */
   int MinMeasuredBWsForAuthToIgnoreAdvertised;
diff --git a/src/feature/dirauth/dirauth_options.inc b/src/feature/dirauth/dirauth_options.inc
index f0aadb006..f3d8e35b3 100644
--- a/src/feature/dirauth/dirauth_options.inc
+++ b/src/feature/dirauth/dirauth_options.inc
@@ -44,6 +44,10 @@ CONF_VAR(AuthDirSharedRandomness, BOOL, 0, "1")
 /* NOTE: remove this option someday. */
 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)
+
 /** As directory authority, accept hidden service directories after what
  * time? */
 CONF_VAR(MinUptimeHidServDirectoryV2, INTERVAL, 0, "96 hours")
diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
index 7caa6bf30..1fd438b7d 100644
--- a/src/feature/dirauth/dirvote.c
+++ b/src/feature/dirauth/dirvote.c
@@ -4664,10 +4664,10 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
     smartlist_add_strdup(v3_out->known_flags, "BadExit");
   smartlist_sort_strings(v3_out->known_flags);
 
-  if (options->ConsensusParams) {
+  if (d_options->ConsensusParams) {
     v3_out->net_params = smartlist_new();
     smartlist_split_string(v3_out->net_params,
-                           options->ConsensusParams, NULL, 0, 0);
+                           d_options->ConsensusParams, NULL, 0, 0);
     smartlist_sort_strings(v3_out->net_params);
   }
   v3_out->bw_file_headers = bw_file_headers;





More information about the tor-commits mailing list