From 488b7dcba7a5dcf5d65349992c7fc32b3d9c17d1 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 31 Jul 2018 07:03:07 +0200 Subject: 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 Signed-off-by: Jason A. Donenfeld --- src/send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/send.c') 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; -- cgit v1.2.3-59-g8ed1b