]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
don't cache connect failures from our own circuits
authorRoger Dingledine <arma@torproject.org>
Tue, 26 Oct 2021 09:40:38 +0000 (05:40 -0400)
committerRoger Dingledine <arma@torproject.org>
Mon, 8 Nov 2021 10:37:02 +0000 (05:37 -0500)
The connect failure cache had a bad interaction with retrying connections
to our guards or bridges when we go offline and then come back online --
while offline we would fail to connect and cache this result, and then
when we return we would decline to even attempt to connect, because our
failure cache said it wouldn't work.

Now only cache connect failures for relays when we connected to them
because of somebody else's EXTEND request.

Fixes bug 40499; bugfix on 0.3.3.4-alpha.

changes/bug40499 [new file with mode: 0644]
src/core/or/connection_or.c

diff --git a/changes/bug40499 b/changes/bug40499
new file mode 100644 (file)
index 0000000..149e9bd
--- /dev/null
@@ -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.
index db9f93e6f6453b0ea09e1c666757b4bc5fbe10c5..0018b1dfd8f5adf2fd33987ba8a3e80fb8601a23 100644 (file)
@@ -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);