]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
use channel_is_client for create cell counts
authorRoger Dingledine <arma@torproject.org>
Mon, 2 Apr 2018 05:00:31 +0000 (01:00 -0400)
committerRoger Dingledine <arma@torproject.org>
Mon, 2 Apr 2018 05:00:31 +0000 (01:00 -0400)
When a relay is collecting internal statistics about how many
create cell requests it has seen of each type, accurately count the
requests from relays that temporarily fall out of the consensus.

(To be extra conservative, we were already ignoring requests from clients
in our counts, and we continue ignoring them here.)

Fixes bug 24910; bugfix on 0.2.4.17-rc.

changes/bug24910 [new file with mode: 0644]
src/or/command.c
src/or/cpuworker.c

diff --git a/changes/bug24910 b/changes/bug24910
new file mode 100644 (file)
index 0000000..58574c0
--- /dev/null
@@ -0,0 +1,7 @@
+  o Minor bugfixes (relay statistics):
+    - When a relay is collecting internal statistics about how many
+      create cell requests it has seen of each type, accurately count the
+      requests from relays that temporarily fall out of the consensus. (To
+      be extra conservative, we were already ignoring requests from
+      clients in our counts, and we continue ignoring them here.) Fixes
+      bug 24910; bugfix on 0.2.4.17-rc.
index 7280be13966cd9dcf6c138af492edf9c1f858dc8..4f99462f38a6212feac786f136b940cab88f4281 100644 (file)
@@ -339,7 +339,9 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
     return;
   }
 
-  if (connection_or_digest_is_known_relay(chan->identity_digest)) {
+  if (!channel_is_client(chan)) {
+    /* remember create types we've seen, but don't remember them from
+     * clients, to be extra conservative about client statistics. */
     rep_hist_note_circuit_handshake_requested(create_cell->handshake_type);
   }
 
index 50761dd4d357fe3494a3186b0764a9e49d16a12c..7da7dc5f8bd4d012ed61c78c9586fb4c1d9e53ac 100644 (file)
@@ -547,7 +547,7 @@ assign_onionskin_to_cpuworker(or_circuit_t *circ,
     return 0;
   }
 
-  if (connection_or_digest_is_known_relay(circ->p_chan->identity_digest))
+  if (!channel_is_client(circ->p_chan))
     rep_hist_note_circuit_handshake_assigned(onionskin->handshake_type);
 
   should_time = should_time_request(onionskin->handshake_type);