Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174779090
D44283.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
D44283.diff
View Options
diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c
--- a/sys/dev/wg/if_wg.c
+++ b/sys/dev/wg/if_wg.c
@@ -1517,8 +1517,7 @@
state = WG_PACKET_CRYPTED;
out:
pkt->p_mbuf = m;
- wmb();
- pkt->p_state = state;
+ atomic_store_rel_int(&pkt->p_state, state);
GROUPTASK_ENQUEUE(&peer->p_send);
noise_remote_put(remote);
}
@@ -1590,8 +1589,7 @@
state = WG_PACKET_CRYPTED;
out:
pkt->p_mbuf = m;
- wmb();
- pkt->p_state = state;
+ atomic_store_rel_int(&pkt->p_state, state);
GROUPTASK_ENQUEUE(&peer->p_recv);
noise_remote_put(remote);
}
@@ -1647,7 +1645,7 @@
wg_peer_get_endpoint(peer, &endpoint);
while ((pkt = wg_queue_dequeue_serial(&peer->p_encrypt_serial)) != NULL) {
- if (pkt->p_state != WG_PACKET_CRYPTED)
+ if (atomic_load_acq_int(&pkt->p_state) != WG_PACKET_CRYPTED)
goto error;
m = pkt->p_mbuf;
@@ -1689,7 +1687,7 @@
struct epoch_tracker et;
while ((pkt = wg_queue_dequeue_serial(&peer->p_decrypt_serial)) != NULL) {
- if (pkt->p_state != WG_PACKET_CRYPTED)
+ if (atomic_load_acq_int(&pkt->p_state) != WG_PACKET_CRYPTED)
goto error;
m = pkt->p_mbuf;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 6, 10:53 PM (10 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40270092
Default Alt Text
D44283.diff (1 KB)
Attached To
Mode
D44283: if_wg: use proper barriers around pkt->p_state
Attached
Detach File
Event Timeline
Log In to Comment