summaryrefslogtreecommitdiffhomepage
path: root/src/peer.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-08-01 15:59:37 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-08-03 00:14:18 +0200
commit9f4cc375561f34a6512f3789edbbd3d7a900145f (patch)
tree06c28c1a36d2b03c79fa6bbffb1a39cd49858dac /src/peer.h
parent7dbb9eec2638b41a0b95f3ca196d3c3a8550173c (diff)
peer: ensure destruction doesn't race
Completely rework peer removal to ensure peers don't jump between contexts and create races. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/peer.h b/src/peer.h
index 059fa64..8daa053 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -58,6 +58,7 @@ struct wireguard_peer {
struct list_head peer_list;
u64 internal_id;
struct napi_struct napi;
+ bool is_dead;
};
struct wireguard_peer *peer_create(struct wireguard_device *wg, const u8 public_key[NOISE_PUBLIC_KEY_LEN], const u8 preshared_key[NOISE_SYMMETRIC_KEY_LEN]);