tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 45416356ed7dc5551cda491c01a4d7df1ed97a20
parent d09e58d9bf0a2c94cec886756351cb718cb31959
Author: David Goulet <dgoulet@torproject.org>
Date:   Wed, 23 Feb 2022 15:21:40 -0500

Merge branch 'tor-gitlab/mr/488'

Diffstat:
Achanges/bug40499 | 7+++++++
Msrc/core/or/connection_or.c | 7+++++++
Msrc/test/test_connection.c | 1+
3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/changes/bug40499 b/changes/bug40499 @@ -0,0 +1,7 @@ + o Major bugfixes (client): + - Stop caching TCP connect failures to relays/bridges when we + initiated the connection as a client. Now we only cache connect + failures as a relay or bridge when we initiated them because + of an EXTEND request. Declining to re-attempt the client-based + connections could cause problems when we lose connectivity and + try to reconnect. Fixes bug 40499; bugfix on 0.3.3.4-alpha. diff --git a/src/core/or/connection_or.c b/src/core/or/connection_or.c @@ -1316,6 +1316,13 @@ note_or_connect_failed(const or_connection_t *or_conn) tor_assert(or_conn); + if (or_conn->potentially_used_for_bootstrapping) { + /* Don't cache connection failures for connections we initiated ourself. + * If these direct connections fail, we're supposed to recognize that + * the destination is down and stop trying. See ticket 40499. */ + return; + } + ocf = or_connect_failure_find(or_conn); if (ocf == NULL) { ocf = or_connect_failure_new(or_conn); diff --git a/src/test/test_connection.c b/src/test/test_connection.c @@ -826,6 +826,7 @@ test_failed_orconn_tracker(void *arg) /* Prepare the OR connection that will be used in this test */ or_connection_t or_conn; + memset(&or_conn, 0, sizeof(or_conn)); tt_int_op(AF_INET,OP_EQ, tor_addr_parse(&or_conn.canonical_orport.addr, "18.0.0.1")); tt_int_op(AF_INET,OP_EQ, tor_addr_parse(&or_conn.base_.addr, "18.0.0.1"));