summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-04-09 11:03:34 +1000
committerteor <teor@torproject.org>2020-04-09 11:03:34 +1000
commit2d6f00e45b3003337242704e0fde2d2adbaa6cf5 (patch)
treee597c27f920beb0c37119d39ad7a491892bbfc35 /src/core
parent34faee0600e4efe2a76a1776f6c9bd3173b3e0c5 (diff)
parent2d7e08d57ef5d3b785cfaa6961d6d3c73fe59535 (diff)
downloadtor-2d6f00e45b3003337242704e0fde2d2adbaa6cf5.tar.gz
tor-2d6f00e45b3003337242704e0fde2d2adbaa6cf5.zip
Merge branch 'maint-0.4.2' into maint-0.4.3
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 d52dc14a32..18940bd81f 100644
--- a/src/core/or/channel.c
+++ b/src/core/or/channel.c
@@ -1859,7 +1859,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 be64b6286e..5f99280030 100644
--- a/src/core/or/dos.c
+++ b/src/core/or/dos.c
@@ -680,7 +680,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;
@@ -701,7 +701,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 b7b1d3f635..b3eca058b8 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);