Commit cde5abfd authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

Move TestingDirAuthTimeToLearnReachability into dirauth module.

parent be9bc598
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -392,7 +392,6 @@ static const config_var_t option_vars_[] = {
  V(DisableOOSCheck,             BOOL,     "1"),
  V(DisableNetwork,              BOOL,     "0"),
  V(DirAllowPrivateAddresses,    BOOL,     "0"),
  V(TestingAuthDirTimeToLearnReachability, INTERVAL, "30 minutes"),
  OBSOLETE("DirListenAddress"),
  V(DirPolicy,                   LINELIST, NULL),
  VPORT(DirPort),
+0 −5
Original line number Diff line number Diff line
@@ -686,11 +686,6 @@ struct or_options_t {
      voting. Only altered on testing networks. */
  int TestingV3AuthVotingStartOffset;

  /** If an authority has been around for less than this amount of time, it
   * does not believe its reachability information is accurate.  Only
   * altered on testing networks. */
  int TestingAuthDirTimeToLearnReachability;

  /** Clients don't download any descriptor this recent, since it will
   * probably not have propagated to enough caches.  Only altered on testing
   * networks. */
+6 −6
Original line number Diff line number Diff line
@@ -213,12 +213,6 @@ options_validate_dirauth_testing(const or_options_t *old_options,
  if (!authdir_mode(options))
    return 0;

  if (options->TestingAuthDirTimeToLearnReachability < 0) {
    REJECT("TestingAuthDirTimeToLearnReachability must be non-negative.");
  } else if (options->TestingAuthDirTimeToLearnReachability > 2*60*60) {
    COMPLAIN("TestingAuthDirTimeToLearnReachability is insanely high.");
  }

  if (!authdir_mode_v3(options))
    return 0;

@@ -443,6 +437,12 @@ dirauth_options_validate(const void *arg, char **msg)
  t = format_recommended_version_list(options->RecommendedServerVersions, 1);
  tor_free(t);

  if (options->TestingAuthDirTimeToLearnReachability < 0) {
    REJECT("TestingAuthDirTimeToLearnReachability must be non-negative.");
  } else if (options->TestingAuthDirTimeToLearnReachability > 2*60*60) {
    COMPLAIN("TestingAuthDirTimeToLearnReachability is insanely high.");
  }

  return 0;
}

+5 −0
Original line number Diff line number Diff line
@@ -65,6 +65,11 @@ CONF_VAR(RecommendedClientVersions, LINELIST, 0, NULL)
/** Which versions of tor should we tell users to run on relays? */
CONF_VAR(RecommendedServerVersions, LINELIST, 0, NULL)

/** If an authority has been around for less than this amount of time, it
 * does not believe its reachability information is accurate.  Only
 * altered on testing networks. */
CONF_VAR(TestingAuthDirTimeToLearnReachability, INTERVAL, 0, "30 minutes")

/** Boolean: is this an authoritative directory that's willing to recommend
 * versions? */
CONF_VAR(VersioningAuthoritativeDirectory, BOOL, 0, "0")
+3 −2
Original line number Diff line number Diff line
@@ -460,8 +460,9 @@ dirserv_get_flag_thresholds_line(void)
int
running_long_enough_to_decide_unreachable(void)
{
  return time_of_process_start
    + get_options()->TestingAuthDirTimeToLearnReachability < approx_time();
  const dirauth_options_t *opts = dirauth_get_options();
  return time_of_process_start +
    opts->TestingAuthDirTimeToLearnReachability < approx_time();
}

/** Each server needs to have passed a reachability test no more
Loading