aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/connection_edge.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-02-01 12:45:32 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-02-01 12:45:32 -0500
commit387d1d8835df1bffa71e5157c41cb856c5f18d7d (patch)
tree100c10a61ee3e890c6db0addbbf73f962199a3dd /src/core/or/connection_edge.c
parent838e07be9dc88d41da39a1b4b6b445f67309b108 (diff)
downloadtor-387d1d8835df1bffa71e5157c41cb856c5f18d7d.tar.gz
tor-387d1d8835df1bffa71e5157c41cb856c5f18d7d.zip
relay: Send back CONNECTION_REFUSED on reentry
The TORPROTOCOL reason causes the client to close the circuit which is not what we want because other valid streams might be on it. Instead, CONNECTION_REFUSED will leave it open but will not allow more streams to be attached to it. The client then open a new circuit to the destination. Closes #40270 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/connection_edge.c')
-rw-r--r--src/core/or/connection_edge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c
index da5431c47e..04005b29a6 100644
--- a/src/core/or/connection_edge.c
+++ b/src/core/or/connection_edge.c
@@ -4293,7 +4293,7 @@ connection_exit_connect(edge_connection_t *edge_conn)
nodelist_reentry_probably_contains(&conn->addr, conn->port)) {
log_info(LD_EXIT, "%s tried to connect back to a known relay address. "
"Closing.", connection_describe(conn));
- connection_edge_end(edge_conn, END_STREAM_REASON_TORPROTOCOL);
+ connection_edge_end(edge_conn, END_STREAM_REASON_CONNECTREFUSED);
circuit_detach_stream(circuit_get_by_edge_conn(edge_conn), edge_conn);
connection_free(conn);
return;