mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
make the default default options.FirewallPorts be the default
svn:r2683
This commit is contained in:
@@ -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
@@ -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
@@ -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
@@ -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.
|
||||
**/
|
||||
|
||||
/*
|
||||
|
||||
@@ -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,
|
||||
|
||||
+2
-4
@@ -178,8 +178,7 @@ router_pick_directory_server_impl(int requireothers, int fascistfirewall)
|
||||
continue;
|
||||
if(fascistfirewall) {
|
||||
tor_snprintf(buf,sizeof(buf),"%d",router->dir_port);
|
||||
if (!smartlist_string_isin(options.FirewallPorts ?
|
||||
options.FirewallPorts : config_get_default_firewallports(), buf))
|
||||
if (!smartlist_string_isin(options.FirewallPorts, buf))
|
||||
continue;
|
||||
}
|
||||
smartlist_add(sl, router);
|
||||
@@ -214,8 +213,7 @@ router_pick_trusteddirserver_impl(int requireother, int fascistfirewall)
|
||||
continue;
|
||||
if (fascistfirewall) {
|
||||
tor_snprintf(buf,sizeof(buf),"%d",d->dir_port);
|
||||
if (!smartlist_string_isin(options.FirewallPorts ?
|
||||
options.FirewallPorts : config_get_default_firewallports(), buf))
|
||||
if (!smartlist_string_isin(options.FirewallPorts, buf))
|
||||
continue;
|
||||
}
|
||||
smartlist_add(sl, d);
|
||||
|
||||
Reference in New Issue
Block a user