mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-21 07:40:44 +08:00
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>
This commit is contained in:

committed by
Jason A. Donenfeld

parent
d1d08426b2
commit
b51010ba13
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user