Commit 1bbd3811 authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

Merge remote-tracking branch 'public/bug10849_025'

Conflicts:
	src/or/config.c
parents 9da17ad4 ce450bdd
Loading
Loading
Loading
Loading

changes/bug10849_025

0 → 100644
+6 −0
Original line number Diff line number Diff line
  o Removed code:
    - The TunnelDirConns and PreferTunnelledDirConns options no longer
      exist; tunneled directory connections have been available since
      0.1.2.5-alpha, and turning them off is not a good idea. This is a
      brute-force fix for 10849, where "TunnelDirConns 0" would break
      hidden services.
+0 −9
Original line number Diff line number Diff line
@@ -593,15 +593,6 @@ GENERAL OPTIONS
    This is useful when running on flash memory or other media that support
    only a limited number of writes. (Default: 0)

[[TunnelDirConns]] **TunnelDirConns** **0**|**1**::
    If non-zero, when a directory server we contact supports it, we will build
    a one-hop circuit and make an encrypted connection via its ORPort.
    (Default: 1)

[[PreferTunneledDirConns]] **PreferTunneledDirConns** **0**|**1**::
    If non-zero, we will avoid directory servers that don't support tunneled
    directory connections, when possible. (Default: 1)

[[CircuitPriorityHalflife]] **CircuitPriorityHalflife** __NUM1__::
    If this value is set, we override the default algorithm for choosing which
    circuit's cell to deliver or relay next. When the value is 0, we
+2 −17
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ static config_var_t option_vars_[] = {
  V(OptimisticData,              AUTOBOOL, "auto"),
  V(PortForwarding,              BOOL,     "0"),
  V(PortForwardingHelper,        FILENAME, "tor-fw-helper"),
  V(PreferTunneledDirConns,      BOOL,     "1"),
  OBSOLETE("PreferTunneledDirConns"),
  V(ProtocolWarnings,            BOOL,     "0"),
  V(PublishServerDescriptor,     CSV,      "1"),
  V(PublishHidServDescriptors,   BOOL,     "1"),
@@ -412,7 +412,7 @@ static config_var_t option_vars_[] = {
  V(TransListenAddress,          LINELIST, NULL),
  VPORT(TransPort,                   LINELIST, NULL),
  V(TransProxyType,              STRING,   "default"),
  V(TunnelDirConns,              BOOL,     "1"),
  OBSOLETE("TunnelDirConns"),
  V(UpdateBridgesFromAuthority,  BOOL,     "0"),
  V(UseBridges,                  BOOL,     "0"),
  V(UseEntryGuards,              BOOL,     "1"),
@@ -3275,12 +3275,6 @@ options_validate(or_options_t *old_options, or_options_t *options,

  if (options->UseBridges && !options->Bridges)
    REJECT("If you set UseBridges, you must specify at least one bridge.");
  if (options->UseBridges && !options->TunnelDirConns)
    REJECT("If you set UseBridges, you must set TunnelDirConns.");
  if (options->RendConfigLines &&
      (!options->TunnelDirConns || !options->PreferTunneledDirConns))
    REJECT("If you are running a hidden service, you must set TunnelDirConns "
           "and PreferTunneledDirConns");

  for (cl = options->Bridges; cl; cl = cl->next) {
      bridge_line_t *bridge_line = parse_bridge_line(cl->value);
@@ -3393,15 +3387,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
                                 AF_INET6, 1, msg)<0)
    return -1;

  if (options->PreferTunneledDirConns && !options->TunnelDirConns)
    REJECT("Must set TunnelDirConns if PreferTunneledDirConns is set.");

  if ((options->Socks4Proxy || options->Socks5Proxy) &&
      !options->HTTPProxy && !options->PreferTunneledDirConns)
    REJECT("When Socks4Proxy or Socks5Proxy is configured, "
           "PreferTunneledDirConns and TunnelDirConns must both be "
           "set to 1, or HTTPProxy must be configured.");

  if (options->AutomapHostsSuffixes) {
    SMARTLIST_FOREACH(options->AutomapHostsSuffixes, char *, suf,
    {
+1 −5
Original line number Diff line number Diff line
@@ -338,8 +338,6 @@ should_use_directory_guards(const or_options_t *options)
  if (options->DownloadExtraInfo || options->FetchDirInfoEarly ||
      options->FetchDirInfoExtraEarly || options->FetchUselessDescriptors)
    return 0;
  if (! options->PreferTunneledDirConns)
    return 0;
  return 1;
}

@@ -834,6 +832,7 @@ directory_command_should_use_begindir(const or_options_t *options,
                                      int or_port, uint8_t router_purpose,
                                      dir_indirection_t indirection)
{
  (void) router_purpose;
  if (!or_port)
    return 0; /* We don't know an ORPort -- no chance. */
  if (indirection == DIRIND_DIRECT_CONN || indirection == DIRIND_ANON_DIRPORT)
@@ -842,9 +841,6 @@ directory_command_should_use_begindir(const or_options_t *options,
    if (!fascist_firewall_allows_address_or(addr, or_port) ||
        directory_fetches_from_authorities(options))
      return 0; /* We're firewalled or are acting like a relay -- also no. */
  if (!options->TunnelDirConns &&
      router_purpose != ROUTER_PURPOSE_BRIDGE)
    return 0; /* We prefer to avoid using begindir conns. Fine. */
  return 1;
}

+1 −1
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ add_an_entry_guard(const node_t *chosen, int reset_status, int prepend,
  } else {
    const routerstatus_t *rs;
    rs = router_pick_directory_server(MICRODESC_DIRINFO|V3_DIRINFO,
                              PDS_PREFER_TUNNELED_DIR_CONNS_|PDS_FOR_GUARD);
                                      PDS_FOR_GUARD);
    if (!rs)
      return NULL;
    node = node_get_by_id(rs->identity_digest);
Loading