]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
device: remove racey read in session key rotation.
authorDavid Anderson <danderson@tailscale.com>
Wed, 11 Mar 2020 00:52:50 +0000 (17:52 -0700)
committerDavid Crawshaw <david@zentus.com>
Fri, 3 Apr 2020 00:35:28 +0000 (11:35 +1100)
commitad256f0b739b835e8836f84571424cb4adc01b1e
treef5b74a1bdfb9b89716bf5fa5dee84931e874ff9f
parentd54f0a61aa623548ad5a6fc3deccf4beca9a0c5a
device: remove racey read in session key rotation.

This code was attempting to use the "compare racily, then lock
and compare again" idiom to try and reduce lock contention.
However, that idiom is not safe to use unless the comparison
uses atomic operations, which this does not.

This change simply deletes the racy read. This makes the code
correct, but potentially increases lock contention.

Signed-off-by: David Anderson <danderson@tailscale.com>
device/noise-protocol.go