]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Revert "cmux: Don't pick a marked for close circuit as active"
authorDavid Goulet <dgoulet@torproject.org>
Thu, 23 Jun 2022 14:55:56 +0000 (10:55 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Thu, 23 Jun 2022 14:55:56 +0000 (10:55 -0400)
This reverts commit 4f1298e4189f8bda8ecf48cf7ff25445698d747a.

changes/ticket25312 [deleted file]
src/core/or/circuitmux_ewma.c

diff --git a/changes/ticket25312 b/changes/ticket25312
deleted file mode 100644 (file)
index 5de1a48..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-  o Minor bugfixes (circuit):
-    - Fix a tiny window where a circuit can be chosen as active but is marked
-      for close. Fixes bug 25312; bugfix on 0.2.4.4-alpha.
index 18c726c9ba6843ae72ab350bad549d5febe61e2c..adf256ab05cf672a710e1f1a9ca9e09507b90e36 100644 (file)
@@ -35,7 +35,6 @@
 #include <math.h>
 
 #include "core/or/or.h"
-#include "core/or/circuit_st.h"
 #include "core/or/circuitmux.h"
 #include "core/or/circuitmux_ewma.h"
 #include "lib/crypt_ops/crypto_rand.h"
@@ -383,17 +382,10 @@ ewma_pick_active_circuit(circuitmux_t *cmux,
 
   pol = TO_EWMA_POL_DATA(pol_data);
 
-  for (int i = 0; i < smartlist_len(pol->active_circuit_pqueue); i++) {
+  if (smartlist_len(pol->active_circuit_pqueue) > 0) {
     /* Get the head of the queue */
-    cell_ewma = smartlist_get(pol->active_circuit_pqueue, i);
+    cell_ewma = smartlist_get(pol->active_circuit_pqueue, 0);
     circ = cell_ewma_to_circuit(cell_ewma);
-    /* Don't send back closed circuit. This is possible because the circuit
-     * is detached from the cmux before the circuit gets freed and not when
-     * marked for close. Because of that, there is a window where a closed
-     * circuit can be picked here. See #25312. */
-    if (circ->marked_for_close) {
-      continue;
-    }
   }
 
   return circ;