summaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-01-26 11:42:52 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-02-22 15:48:42 -0500
commit94b56eaa7597e4a091a5b51d2c9032ea046631e3 (patch)
tree4c5c2d9cb88e023431028338145ab286d74341da /src/feature
parent6e3a7c410f2c0cfd2f705862cc4d32acd0a88096 (diff)
downloadtor-94b56eaa7597e4a091a5b51d2c9032ea046631e3.tar.gz
tor-94b56eaa7597e4a091a5b51d2c9032ea046631e3.zip
dos: New client connect rate detection
This is a new detection type which is that a relay can now control the rate of client connections from a single address. The mechanism is pretty simple, if the rate/burst is reached, the address is marked for a period of time and any connection from that address is denied. Closes #40253 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/stats/geoip_stats.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/feature/stats/geoip_stats.c b/src/feature/stats/geoip_stats.c
index a733653dde..aa9f91c136 100644
--- a/src/feature/stats/geoip_stats.c
+++ b/src/feature/stats/geoip_stats.c
@@ -196,6 +196,8 @@ clientmap_entry_new(geoip_client_action_t action, const tor_addr_t *addr,
if (transport_name) {
entry->transport_name = tor_strdup(transport_name);
}
+ /* Initialize the DoS object. */
+ dos_geoip_entry_init(entry);
/* Allocated and initialized, note down its size for the OOM handler. */
geoip_increment_client_history_cache_size(clientmap_entry_size(entry));