aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-31 07:03:07 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-31 07:19:52 +0200
commitb713ab0e605b4f9291f4fde38103bf689c2cdb76 (patch)
treee18f74fc2795b8c8b80141e8bf411a8a22959dc2 /src/send.c
parentratelimiter: prevent init/uninit race (diff)
downloadwireguard-monolithic-historical-b713ab0e605b4f9291f4fde38103bf689c2cdb76.tar.xz
wireguard-monolithic-historical-b713ab0e605b4f9291f4fde38103bf689c2cdb76.zip
peer: simplify rcu reference counts
Use RCU reference counts only when we must, and otherwise use a more reasonably named function. Reported-by: Jann Horn <jann@thejh.net>
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/send.c b/src/send.c
index 7a8bea1..90dab85 100644
--- a/src/send.c
+++ b/src/send.c
@@ -61,7 +61,7 @@ void packet_send_queued_handshake_initiation(struct wireguard_peer *peer, bool i
if (!has_expired(peer->last_sent_handshake, REKEY_TIMEOUT))
return;
- peer = peer_rcu_get(peer);
+ peer_get(peer);
/* Queues up calling packet_send_queued_handshakes(peer), where we do a peer_put(peer) after: */
if (!queue_work(peer->device->handshake_send_wq, &peer->transmit_handshake_work))
peer_put(peer); /* If the work was already queued, we want to drop the extra reference */
@@ -320,7 +320,7 @@ void packet_send_staged_packets(struct wireguard_peer *peer)
}
packets.prev->next = NULL;
- peer_rcu_get(keypair->entry.peer);
+ peer_get(keypair->entry.peer);
PACKET_CB(packets.next)->keypair = keypair;
packet_create_data(packets.next);
return;