wg_noise: no need to enter epoch here

Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
This commit is contained in:
Matt Dunwoodie 2021-04-20 09:19:49 +10:00
parent aaa7ff5498
commit 73bc4e87c7
1 changed files with 1 additions and 6 deletions

View File

@ -610,16 +610,11 @@ noise_add_new_keypair(struct noise_local *l, struct noise_remote *r,
static int
noise_received_with(struct noise_keypair *kp)
{
struct epoch_tracker et;
struct noise_keypair *old;
struct noise_remote *r = kp->kp_remote;
NET_EPOCH_ENTER(et);
if (kp != epoch_ptr_read(&r->r_next)) {
NET_EPOCH_EXIT(et);
if (kp != epoch_ptr_read(&r->r_next))
return (0);
}
NET_EPOCH_EXIT(et);
rw_wlock(&r->r_keypair_lock);
if (kp != epoch_ptr_read(&r->r_next)) {