aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-04-09 11:03:20 +1000
committerteor <teor@torproject.org>2020-04-09 11:03:20 +1000
commit987f2fa50ac26af61917c7a6e13dc62f3ddb23ee (patch)
tree7c0c4b59e3c9658365491d337609cd0957611991 /src/core
parent26fd31fef8dfbc9babf60157edf1b47b94cd49d1 (diff)
parentd380acaecad5f554f7294cfcd7fbf100f9bbaca3 (diff)
downloadtor-987f2fa50ac26af61917c7a6e13dc62f3ddb23ee.tar.gz
tor-987f2fa50ac26af61917c7a6e13dc62f3ddb23ee.zip
Merge branch 'maint-0.3.5' into maint-0.4.1
Diffstat (limited to 'src/core')
-rw-r--r--src/core/or/channel.c2
-rw-r--r--src/core/or/dos.c4
-rw-r--r--src/core/or/dos.h3
3 files changed, 5 insertions, 4 deletions
diff --git a/src/core/or/channel.c b/src/core/or/channel.c
index 0e190809ba..596932b008 100644
--- a/src/core/or/channel.c
+++ b/src/core/or/channel.c
@@ -1882,7 +1882,7 @@ channel_do_open_actions(channel_t *chan)
tor_free(transport_name);
/* Notify the DoS subsystem of a new client. */
if (tlschan && tlschan->conn) {
- dos_new_client_conn(tlschan->conn);
+ dos_new_client_conn(tlschan->conn, transport_name);
}
}
/* Otherwise the underlying transport can't tell us this, so skip it */
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
diff --git a/src/core/or/dos.h b/src/core/or/dos.h
index b5154a7cd2..a46f65d767 100644
--- a/src/core/or/dos.h
+++ b/src/core/or/dos.h
@@ -53,7 +53,8 @@ int dos_enabled(void);
void dos_log_heartbeat(void);
void dos_geoip_entry_about_to_free(const struct clientmap_entry_t *geoip_ent);
-void dos_new_client_conn(or_connection_t *or_conn);
+void dos_new_client_conn(or_connection_t *or_conn,
+ const char *transport_name);
void dos_close_client_conn(const or_connection_t *or_conn);
int dos_should_refuse_single_hop_client(void);