summaryrefslogtreecommitdiffhomepage
path: root/device/tun.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2022-08-30 07:43:11 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2022-09-04 12:57:30 +0200
commitb51010ba13f0a3e59808fbdb1566cd2c6b834b95 (patch)
tree37a6753e5604c13f7141bd5613b0ab80e7b794f7 /device/tun.go
parentd1d08426b27b57990b1ee6782794f56d2c002aa3 (diff)
all: use Go 1.19 and its atomic types
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/tun.go')
-rw-r--r--device/tun.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/device/tun.go b/device/tun.go
index 4af9548..d94bde1 100644
--- a/device/tun.go
+++ b/device/tun.go
@@ -7,7 +7,6 @@ package device
import (
"fmt"
- "sync/atomic"
"golang.zx2c4.com/wireguard/tun"
)
@@ -33,7 +32,7 @@ func (device *Device) RoutineTUNEventReader() {
tooLarge = fmt.Sprintf(" (too large, capped at %v)", MaxContentSize)
mtu = MaxContentSize
}
- old := atomic.SwapInt32(&device.tun.mtu, int32(mtu))
+ old := device.tun.mtu.Swap(int32(mtu))
if int(old) != mtu {
device.log.Verbosef("MTU updated: %v%s", mtu, tooLarge)
}