summaryrefslogtreecommitdiffhomepage
path: root/device/device.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-01-28 15:26:22 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-28 15:26:22 +0100
commit6a128dde71d925fd4865ebd86855213a429b4729 (patch)
tree9c35e42da3583e1ec7fa88bb514f50b7feaf51e4 /device/device.go
parent34c047c762c31911333833c56a6dc50c52c84f5f (diff)
device: do not allow get to run while set runs
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/device.go')
-rw-r--r--device/device.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/device/device.go b/device/device.go
index e769a20..c6b62ea 100644
--- a/device/device.go
+++ b/device/device.go
@@ -23,7 +23,6 @@ type Device struct {
isUp AtomicBool // device is (going) up
isClosed AtomicBool // device is closed? (acting as guard)
log *Logger
- ipcSetMu sync.Mutex // serializes UAPI set operations
// synchronized resources (locks acquired in order)
@@ -89,6 +88,8 @@ type Device struct {
device tun.Device
mtu int32
}
+
+ ipcMutex sync.RWMutex
}
// An encryptionQueue is a channel of QueueOutboundElements awaiting encryption.