aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/or/connection_or.c7
-rw-r--r--src/test/test_connection.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/or/connection_or.c b/src/core/or/connection_or.c
index db9f93e6f6..0018b1dfd8 100644
--- 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
index 87940f71e6..fbf9d6a5ab 100644
--- 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"));