diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-08-04 02:50:51 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-08-04 05:14:15 +0200 |
commit | f1ccce3fccbf21422c18fdc45fc89cc5af46b290 (patch) | |
tree | 9d64d51f821c712aaf21795aa2652fa054b18de9 /src/allowedips.c | |
parent | 875c926fc72a1aa847c215534ee49c36106d2b56 (diff) |
send: switch handshake stamp to an atomic
Rather than abusing the handshake lock, we're much better off just using
a boring atomic64 for this. It's simpler and performs better.
Also, while we're at it, we set the handshake stamp both before and
after the calculations, in case the calculations block for a really long
time waiting for the RNG to initialize. Otherwise it's possible that
when the RNG finally initializes, two handshakes are sent back to back,
which isn't sensible.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/allowedips.c')
0 files changed, 0 insertions, 0 deletions