Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108586704
D35993.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35993.diff
View Options
Index: sys/dev/wg/wg_noise.c
===================================================================
--- sys/dev/wg/wg_noise.c
+++ sys/dev/wg/wg_noise.c
@@ -796,7 +796,7 @@
return (EINVAL);
#ifdef __LP64__
- *send = ck_pr_faa_64(&kp->kp_nonce_send, 1);
+ *send = atomic_fetchadd_64(&kp->kp_nonce_send, 1);
#else
rw_wlock(&kp->kp_nonce_lock);
*send = kp->kp_nonce_send++;
@@ -835,7 +835,7 @@
(i + index_current) &
((COUNTER_BITS_TOTAL / COUNTER_BITS) - 1)] = 0;
#ifdef __LP64__
- ck_pr_store_64(&kp->kp_nonce_recv, recv);
+ atomic_store_64(&kp->kp_nonce_recv, recv);
#else
kp->kp_nonce_recv = recv;
#endif
@@ -867,7 +867,7 @@
if (!keep_key_fresh)
goto out;
#ifdef __LP64__
- nonce = ck_pr_load_64(¤t->kp_nonce_send);
+ nonce = atomic_load_64(¤t->kp_nonce_send);
#else
rw_rlock(¤t->kp_nonce_lock);
nonce = current->kp_nonce_send;
@@ -920,7 +920,7 @@
int ret;
#ifdef __LP64__
- cur_nonce = ck_pr_load_64(&kp->kp_nonce_recv);
+ cur_nonce = atomic_load_64(&kp->kp_nonce_recv);
#else
rw_rlock(&kp->kp_nonce_lock);
cur_nonce = kp->kp_nonce_recv;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 4:20 PM (6 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16200727
Default Alt Text
D35993.diff (1 KB)
Attached To
Mode
D35993: wg_noise: Use atomic(9) for kp_nonce_send/recv.
Attached
Detach File
Event Timeline
Log In to Comment