diff options
author | David Goulet <dgoulet@torproject.org> | 2018-01-30 09:33:12 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-01-30 09:33:12 -0500 |
commit | cd81403cc0d73d53cb7f3650b38d49c54100af25 (patch) | |
tree | 5ea4f0c626ad082fb195a478614f67dff1a7b386 /src/or/config.c | |
parent | 03ab24b44cd148263cfb2b801cba35489e3852c1 (diff) | |
parent | 9aca7d47306222f2870ec16a7291a8215d6c3316 (diff) | |
download | tor-cd81403cc0d73d53cb7f3650b38d49c54100af25.tar.gz tor-cd81403cc0d73d53cb7f3650b38d49c54100af25.zip |
Merge branch 'ticket24902_029_05' into ticket24902_033_02
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index afaf867851..f6875b7ed5 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -81,6 +81,7 @@ #include "dirserv.h" #include "dirvote.h" #include "dns.h" +#include "dos.h" #include "entrynodes.h" #include "git_revision.h" #include "geoip.h" @@ -316,6 +317,19 @@ static config_var_t option_vars_[] = { OBSOLETE("DynamicDHGroups"), VPORT(DNSPort), OBSOLETE("DNSListenAddress"), + /* DoS circuit creation options. */ + V(DoSCircuitCreationEnabled, AUTOBOOL, "auto"), + V(DoSCircuitCreationMinConnections, UINT, "0"), + V(DoSCircuitCreationRate, UINT, "0"), + V(DoSCircuitCreationBurst, UINT, "0"), + V(DoSCircuitCreationDefenseType, INT, "0"), + V(DoSCircuitCreationDefenseTimePeriod, INTERVAL, "0"), + /* DoS connection options. */ + V(DoSConnectionEnabled, AUTOBOOL, "auto"), + V(DoSConnectionMaxConcurrentCount, UINT, "0"), + V(DoSConnectionDefenseType, INT, "0"), + /* DoS single hop client options. */ + V(DoSRefuseSingleHopClientRendezvous, AUTOBOOL, "auto"), V(DownloadExtraInfo, BOOL, "0"), V(TestingEnableConnBwEvent, BOOL, "0"), V(TestingEnableCellStatsEvent, BOOL, "0"), @@ -2323,6 +2337,17 @@ options_act(const or_options_t *old_options) } } + /* DoS mitigation subsystem only applies to public relay. */ + if (public_server_mode(options)) { + /* If we are configured as a relay, initialize the subsystem. Even on HUP, + * this is safe to call as it will load data from the current options + * or/and the consensus. */ + dos_init(); + } else if (old_options && public_server_mode(old_options)) { + /* Going from relay to non relay, clean it up. */ + dos_free_all(); + } + /* Load the webpage we're going to serve every time someone asks for '/' on our DirPort. */ tor_free(global_dirfrontpagecontents); |