[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Switch an int32_t bin to a circpad_hist_index_t.



commit 18de065cbbcd9863842fc7f773033f295a0000dc
Author: George Kadianakis <desnacked@xxxxxxxxxx>
Date:   Mon Feb 25 14:01:55 2019 +0200

    Switch an int32_t bin to a circpad_hist_index_t.
---
 src/core/or/circuitpadding.c | 2 +-
 src/core/or/circuitpadding.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/core/or/circuitpadding.c b/src/core/or/circuitpadding.c
index 29a618930..b7e4b5684 100644
--- a/src/core/or/circuitpadding.c
+++ b/src/core/or/circuitpadding.c
@@ -293,7 +293,7 @@ circpad_histogram_usec_to_bin(const circpad_machine_state_t *mi,
 {
   const circpad_state_t *state = circpad_machine_current_state(mi);
   circpad_delay_t rtt_add_usec = 0;
-  int32_t bin;
+  circpad_hist_index_t bin;
 
   /* Our state should have been checked to be non-null by the caller
    * (circpad_machine_remove_token()) */
diff --git a/src/core/or/circuitpadding.h b/src/core/or/circuitpadding.h
index ca19e31ca..74f9f35c9 100644
--- a/src/core/or/circuitpadding.h
+++ b/src/core/or/circuitpadding.h
@@ -235,6 +235,9 @@ typedef uint16_t circpad_statenum_t;
  *
  * Memory concerns are not so great here since the corresponding histogram and
  * histogram_edges arrays are global and not per-circuit.
+ *
+ * If we ever upgrade this to a value that can't be represented by 8-bits we
+ * also need to upgrade circpad_hist_index_t.
  */
 #define CIRCPAD_MAX_HISTOGRAM_LEN (100)
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits