summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-03 19:38:24 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-10 15:49:28 +0900
commit4717d0f2fbcbcab63998c2fe3667fc935f86a904 (patch)
treea3fd942bc48bf7e4c7dbbe2365714c9bed98a658
parent27e7d2fe25ed1bcfa72b3fc9d9728bcff34ca14d (diff)
device: wait for all peers to be freed before destroying
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index efd0340..633ae9c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -215,6 +215,7 @@ static void destruct(struct net_device *dev)
packet_queue_free(&wg->decrypt_queue, true);
packet_queue_free(&wg->encrypt_queue, true);
destroy_workqueue(wg->packet_crypt_wq);
+ rcu_barrier_bh(); /* Wait for all the peers to be actually freed. */
routing_table_free(&wg->peer_routing_table, &wg->device_update_lock);
ratelimiter_uninit();
memzero_explicit(&wg->static_identity, sizeof(struct noise_static_identity));