diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-31 07:03:07 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-31 07:19:52 +0200 |
commit | b713ab0e605b4f9291f4fde38103bf689c2cdb76 (patch) | |
tree | e18f74fc2795b8c8b80141e8bf411a8a22959dc2 /src/send.c | |
parent | ratelimiter: prevent init/uninit race (diff) | |
download | wireguard-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |