aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-09-15 23:58:38 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-09-16 00:16:17 +0200
commit4f739cddb9f37b9780c9b0f4d1222b0be8d7e723 (patch)
treeeb9f568c5c2e4345c852721adc49daa96eb12305 /src/send.c
parentdata: switch to multiconsumer model with spinlocks (diff)
downloadwireguard-monolithic-historical-jd/lockless-queuing.tar.xz
wireguard-monolithic-historical-jd/lockless-queuing.zip
data: move from spinlocks to lockless data structurejd/lockless-queuing
Reference: https://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html Original-code-from: @aegis
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/send.c b/src/send.c
index f270ad2..850f771 100644
--- a/src/send.c
+++ b/src/send.c
@@ -111,7 +111,7 @@ void packet_send_keepalive(struct wireguard_peer *peer)
struct sk_buff *skb;
struct sk_buff_head queue;
- if (list_empty(&peer->init_queue.queue)) {
+ if (!atomic_read(&peer->init_queue.len)) {
skb = alloc_skb(DATA_PACKET_HEAD_ROOM + MESSAGE_MINIMUM_LENGTH, GFP_ATOMIC);
if (unlikely(!skb))
return;