Page MenuHomeFreeBSD

D44283.diff
No OneTemporary

D44283.diff

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

Mime Type
text/plain
Expires
Wed, Sep 25, 2:26 PM (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12761130
Default Alt Text
D44283.diff (1 KB)

Event Timeline