diff --git a/sys/dev/wg/wg_noise.c b/sys/dev/wg/wg_noise.c --- a/sys/dev/wg/wg_noise.c +++ b/sys/dev/wg/wg_noise.c @@ -563,16 +563,16 @@ struct noise_keypair *kp; mtx_lock(&r->r_keypair_mtx); - kp = ck_pr_load_ptr(&r->r_next); - ck_pr_store_ptr(&r->r_next, NULL); + kp = r->r_next; + r->r_next = NULL; noise_keypair_drop(kp); - kp = ck_pr_load_ptr(&r->r_current); - ck_pr_store_ptr(&r->r_current, NULL); + kp = r->r_current; + r->r_current = NULL; noise_keypair_drop(kp); - kp = ck_pr_load_ptr(&r->r_previous); - ck_pr_store_ptr(&r->r_previous, NULL); + kp = r->r_previous; + r->r_previous = NULL; noise_keypair_drop(kp); mtx_unlock(&r->r_keypair_mtx); } @@ -605,24 +605,24 @@ /* Insert into the keypair table */ mtx_lock(&r->r_keypair_mtx); - next = ck_pr_load_ptr(&r->r_next); - current = ck_pr_load_ptr(&r->r_current); - previous = ck_pr_load_ptr(&r->r_previous); + next = r->r_next; + current = r->r_current; + previous = r->r_previous; if (kp->kp_is_initiator) { if (next != NULL) { - ck_pr_store_ptr(&r->r_next, NULL); - ck_pr_store_ptr(&r->r_previous, next); + r->r_next = NULL; + r->r_previous = next; noise_keypair_drop(current); } else { - ck_pr_store_ptr(&r->r_previous, current); + r->r_previous = current; } noise_keypair_drop(previous); - ck_pr_store_ptr(&r->r_current, kp); + r->r_current = kp; } else { - ck_pr_store_ptr(&r->r_next, kp); + r->r_next = kp; noise_keypair_drop(next); - ck_pr_store_ptr(&r->r_previous, NULL); + r->r_previous = NULL; noise_keypair_drop(previous); } @@ -727,20 +727,20 @@ struct noise_keypair *old; struct noise_remote *r = kp->kp_remote; - if (kp != ck_pr_load_ptr(&r->r_next)) + if (kp != r->r_next) return (0); mtx_lock(&r->r_keypair_mtx); - if (kp != ck_pr_load_ptr(&r->r_next)) { + if (kp != r->r_next) { mtx_unlock(&r->r_keypair_mtx); return (0); } - old = ck_pr_load_ptr(&r->r_previous); - ck_pr_store_ptr(&r->r_previous, ck_pr_load_ptr(&r->r_current)); + old = r->r_previous; + r->r_previous = r->r_current; noise_keypair_drop(old); - ck_pr_store_ptr(&r->r_current, kp); - ck_pr_store_ptr(&r->r_next, NULL); + r->r_current = kp; + r->r_next = NULL; mtx_unlock(&r->r_keypair_mtx); return (ECONNRESET);