aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/dos.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-03-10 14:45:13 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-03-10 14:45:13 -0400
commit894ff2dc8422cb86312c512698acd76476224f87 (patch)
tree6be4ed48b020021d68cb54d10ec61b7382382fef /src/core/or/dos.c
parentb9c7c61ea5233854ff83257a8bc530b7e0a50351 (diff)
downloadtor-894ff2dc8422cb86312c512698acd76476224f87.tar.gz
tor-894ff2dc8422cb86312c512698acd76476224f87.zip
dos: Pass transport name on new client connection
For a bridge configured with a pluggable transport, the transport name is used, with the IP address, for the GeoIP client cache entry. However, the DoS subsystem was not aware of it and always passing NULL when doing a lookup into the GeoIP cache. This resulted in bridges with a PT are never able to apply DoS defenses for newly created connections. Fixes #33491 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/dos.c')
-rw-r--r--src/core/or/dos.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/or/dos.c b/src/core/or/dos.c
index 5f9bbf90ab..d06eaa6d05 100644
--- a/src/core/or/dos.c
+++ b/src/core/or/dos.c
@@ -671,7 +671,7 @@ dos_log_heartbeat(void)
/* Called when a new client connection has been established on the given
* address. */
void
-dos_new_client_conn(or_connection_t *or_conn)
+dos_new_client_conn(or_connection_t *or_conn, const char *transport_name)
{
clientmap_entry_t *entry;
@@ -692,7 +692,7 @@ dos_new_client_conn(or_connection_t *or_conn)
}
/* We are only interested in client connection from the geoip cache. */
- entry = geoip_lookup_client(&or_conn->real_addr, NULL,
+ entry = geoip_lookup_client(&or_conn->real_addr, transport_name,
GEOIP_CLIENT_CONNECT);
if (BUG(entry == NULL)) {
/* Should never happen because we note down the address in the geoip