From 81eb0e30f9b39e99d1bb7b56828fd32e50ea055a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 1 Aug 2018 15:59:37 +0200 Subject: peer: ensure destruction doesn't race Completely rework peer removal to ensure peers don't jump between contexts and create races. --- src/compat/compat.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/compat/compat.h') diff --git a/src/compat/compat.h b/src/compat/compat.h index 5b3075b..86df5f3 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -51,6 +51,9 @@ #ifndef READ_ONCE #define READ_ONCE ACCESS_ONCE #endif +#ifndef WRITE_ONCE +#define WRITE_ONCE(p, v) (ACCESS_ONCE(p) = (v)) +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) #include "udp_tunnel/udp_tunnel_partial_compat.h" -- cgit v1.2.3-59-g8ed1b