diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-05-05 12:13:33 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-05 12:13:58 -0400 |
commit | 8127f4db30799d96b786509b74f49db4768cf6f1 (patch) | |
tree | 3944889ec037d70c04235c74c00871d6a99d357c /src | |
parent | 388478561dd4457afedf530591f02cb05864b187 (diff) | |
download | tor-8127f4db30799d96b786509b74f49db4768cf6f1.tar tor-8127f4db30799d96b786509b74f49db4768cf6f1.tar.gz |
Use siphash on channel/circuit-id map too
Fixes ticket 11750.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitlist.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 90fc93f3a..58fb22d8c 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -76,7 +76,14 @@ chan_circid_entries_eq_(chan_circid_circuit_map_t *a, static INLINE unsigned int chan_circid_entry_hash_(chan_circid_circuit_map_t *a) { - return ((unsigned)a->circ_id) ^ (unsigned)(uintptr_t)(a->chan); + struct { + void *chan; + circid_t circid; + } s; + memset(&s, 0, sizeof(s)); + s.chan = a->chan; + s.circid = a->circ_id; + return (unsigned) siphash24g(&s, sizeof(s)); } /** Map from [chan,circid] to circuit. */ |