Commit 2ba3a9de authored by Roger Dingledine's avatar Roger Dingledine
Browse files

make the default default options.FirewallPorts be the default


svn:r2683
parent 311695e2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1144,8 +1144,7 @@ static routerinfo_t *choose_good_entry_server(cpath_build_state_t *state)
    for(i=0; i < smartlist_len(rl->routers); i++) {
      r = smartlist_get(rl->routers, i);
      tor_snprintf(buf, sizeof(buf), "%d", r->or_port);
      if (!smartlist_string_isin(options.FirewallPorts ?
          options.FirewallPorts : config_get_default_firewallports(), buf))
      if (!smartlist_string_isin(options.FirewallPorts, buf))
         smartlist_add(excluded, r);
    }
  }
+1 −12
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ static config_var_t config_vars[] = {
  VAR("ExitPolicy",          LINELIST, ExitPolicy,           NULL),
  VAR("ExcludeNodes",        STRING,   ExcludeNodes,         NULL),
  VAR("FascistFirewall",     BOOL,     FascistFirewall,      "0"),
  VAR("FirewallPorts",       CSV,      FirewallPorts,        NULL),
  VAR("FirewallPorts",       CSV,      FirewallPorts,        "80,443"),
  VAR("MyFamily",            STRING,   MyFamily,             NULL),
  VAR("NodeFamily",          LINELIST, NodeFamilies,         NULL),
  VAR("Group",               STRING,   Group,                NULL),
@@ -831,17 +831,6 @@ static int check_nickname_list(const char *lst, const char *name)
  return r;
}

smartlist_t *config_get_default_firewallports(void) {
  static smartlist_t *answer;

  if(!answer) {
    answer = smartlist_create();
    smartlist_add(answer, tor_strdup("80"));
    smartlist_add(answer, tor_strdup("443"));
  }
  return answer;
}

static int
validate_options(or_options_t *options)
{
+1 −2
Original line number Diff line number Diff line
@@ -132,8 +132,7 @@ directory_post_to_dirservers(uint8_t purpose, const char *payload,
      if (options.FascistFirewall && purpose == DIR_PURPOSE_UPLOAD_DIR &&
          !options.HttpProxy) {
        tor_snprintf(buf,sizeof(buf),"%d",ds->dir_port);
        if (!smartlist_string_isin(options.FirewallPorts ?
            options.FirewallPorts : config_get_default_firewallports(), buf))
        if (!smartlist_string_isin(options.FirewallPorts, buf))
          continue;
      }
      directory_initiate_command_trusted_dir(ds, purpose, payload, payload_len);
+3 −1
Original line number Diff line number Diff line
@@ -5,7 +5,9 @@
/**
 * \file hibernate.c
 * \brief Functions to close listeners, stop allowing new circuits,
 * etc in preparation for closing down or going dormant.
 * etc in preparation for closing down or going dormant; and to track
 * bandwidth and time intervals to know when to hibernate and when to
 * stop hibernating.
 **/

/*
+0 −1
Original line number Diff line number Diff line
@@ -1088,7 +1088,6 @@ struct config_line_t {

int config_assign_default_dirservers(void);
int resolve_my_address(const char *address, uint32_t *addr);
smartlist_t *config_get_default_firewallports(void);
int getconfig(int argc, char **argv, or_options_t *options);
int config_init_logs(or_options_t *options);
void config_parse_exit_policy(struct config_line_t *cfg,
Loading