Skip to content

Commit 55c9f51

Browse files
committed
Kit: Go: bump to latest API
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 504c7a7 commit 55c9f51

File tree

7 files changed

+86
-75
lines changed

7 files changed

+86
-75
lines changed

Sources/WireGuardKit/WireGuardAdapter.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ public class WireGuardAdapter {
6262

6363
/// Returns a WireGuard version.
6464
class var backendVersion: String {
65-
return String(cString: wgVersion())
65+
guard let ver = wgVersion() else { return "unknown" }
66+
let str = String(cString: ver)
67+
free(UnsafeMutableRawPointer(mutating: ver))
68+
return str
6669
}
6770

6871
/// Returns the tunnel device interface name, or nil on error.
@@ -265,7 +268,7 @@ public class WireGuardAdapter {
265268
.takeUnretainedValue()
266269

267270
let swiftString = String(cString: message).trimmingCharacters(in: .newlines)
268-
let tunnelLogLevel = WireGuardLogLevel(rawValue: logLevel) ?? .debug
271+
let tunnelLogLevel = WireGuardLogLevel(rawValue: logLevel) ?? .verbose
269272

270273
unretainedSelf.logHandler(tunnelLogLevel, swiftString)
271274
}
@@ -369,9 +372,9 @@ public class WireGuardAdapter {
369372
switch result {
370373
case .success((let sourceEndpoint, let resolvedEndpoint)):
371374
if sourceEndpoint.host == resolvedEndpoint.host {
372-
self.logHandler(.debug, "DNS64: mapped \(sourceEndpoint.host) to itself.")
375+
self.logHandler(.verbose, "DNS64: mapped \(sourceEndpoint.host) to itself.")
373376
} else {
374-
self.logHandler(.debug, "DNS64: mapped \(sourceEndpoint.host) to \(resolvedEndpoint.host)")
377+
self.logHandler(.verbose, "DNS64: mapped \(sourceEndpoint.host) to \(resolvedEndpoint.host)")
375378
}
376379
case .failure(let resolutionError):
377380
self.logHandler(.error, "Failed to resolve endpoint \(resolutionError.address): \(resolutionError.errorDescription ?? "(nil)")")
@@ -382,7 +385,7 @@ public class WireGuardAdapter {
382385
/// Helper method used by network path monitor.
383386
/// - Parameter path: new network path
384387
private func didReceivePathUpdate(path: Network.NWPath) {
385-
self.logHandler(.debug, "Network change detected with \(path.status) route and interface order \(path.availableInterfaces)")
388+
self.logHandler(.verbose, "Network change detected with \(path.status) route and interface order \(path.availableInterfaces)")
386389

387390
#if os(macOS)
388391
if case .started(let handle, _) = self.state {
@@ -399,7 +402,7 @@ public class WireGuardAdapter {
399402
wgDisableSomeRoamingForBrokenMobileSemantics(handle)
400403
wgBumpSockets(handle)
401404
} else {
402-
self.logHandler(.info, "Connectivity offline, pausing backend.")
405+
self.logHandler(.verbose, "Connectivity offline, pausing backend.")
403406

404407
self.state = .temporaryShutdown(settingsGenerator)
405408
wgTurnOff(handle)
@@ -408,7 +411,7 @@ public class WireGuardAdapter {
408411
case .temporaryShutdown(let settingsGenerator):
409412
guard path.status.isSatisfiable else { return }
410413

411-
self.logHandler(.info, "Connectivity online, resuming backend.")
414+
self.logHandler(.verbose, "Connectivity online, resuming backend.")
412415

413416
do {
414417
try self.setNetworkSettings(settingsGenerator.generateNetworkSettings())
@@ -436,9 +439,8 @@ public class WireGuardAdapter {
436439

437440
/// A enum describing WireGuard log levels defined in `api-ios.go`.
438441
public enum WireGuardLogLevel: Int32 {
439-
case debug = 0
440-
case info = 1
441-
case error = 2
442+
case verbose = 0
443+
case error = 1
442444
}
443445

444446
private extension Network.NWPath.Status {

Sources/WireGuardKitGo/Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Copyright (C) 2018-2019 Jason A. Donenfeld <[email protected]>. All Rights Reserved.
44

55
# These are generally passed to us by xcode, but we set working defaults for standalone compilation too.
6-
ARCHS ?= x86_64 #TODO: add arm64 to this list once we support apple silicon
7-
SDK_NAME ?= macosx
8-
SDKROOT ?= $(shell xcrun --sdk $(SDK_NAME) --show-sdk-path)
6+
ARCHS ?= x86_64 arm64
7+
PLATFORM_NAME ?= macosx
8+
SDKROOT ?= $(shell xcrun --sdk $(PLATFORM_NAME) --show-sdk-path)
99
CONFIGURATION_BUILD_DIR ?= $(CURDIR)/out
1010
CONFIGURATION_TEMP_DIR ?= $(CURDIR)/.tmp
1111

@@ -17,6 +17,8 @@ BUILDDIR ?= $(CONFIGURATION_TEMP_DIR)/wireguard-go-bridge
1717
CFLAGS_PREFIX := $(if $(DEPLOYMENT_TARGET_CLANG_FLAG_NAME),-$(DEPLOYMENT_TARGET_CLANG_FLAG_NAME)=$($(DEPLOYMENT_TARGET_CLANG_ENV_NAME)),) -isysroot $(SDKROOT) -arch
1818
GOARCH_arm64 := arm64
1919
GOARCH_x86_64 := amd64
20+
GOOS_macosx := darwin
21+
GOOS_iphoneos := ios
2022

2123
build: $(DESTDIR)/libwg-go.a
2224
version-header: $(DESTDIR)/wireguard-go-version.h
@@ -34,16 +36,16 @@ define libwg-go-a
3436
$(BUILDDIR)/libwg-go-$(1).a: export CGO_ENABLED := 1
3537
$(BUILDDIR)/libwg-go-$(1).a: export CGO_CFLAGS := $(CFLAGS_PREFIX) $(ARCH)
3638
$(BUILDDIR)/libwg-go-$(1).a: export CGO_LDFLAGS := $(CFLAGS_PREFIX) $(ARCH)
37-
$(BUILDDIR)/libwg-go-$(1).a: export GOOS := darwin
39+
$(BUILDDIR)/libwg-go-$(1).a: export GOOS := $(GOOS_$(PLATFORM_NAME))
3840
$(BUILDDIR)/libwg-go-$(1).a: export GOARCH := $(GOARCH_$(1))
3941
$(BUILDDIR)/libwg-go-$(1).a: $(GOROOT)/.prepared go.mod
40-
go build -tags ios -ldflags=-w -trimpath -v -o "$(BUILDDIR)/libwg-go-$(1).a" -buildmode c-archive
42+
go build -ldflags=-w -trimpath -v -o "$(BUILDDIR)/libwg-go-$(1).a" -buildmode c-archive
4143
rm -f "$(BUILDDIR)/libwg-go-$(1).h"
4244
endef
4345
$(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH))))
4446

45-
$(DESTDIR)/wireguard-go-version.h: $(GOROOT)/.prepared go.mod
46-
go list -m golang.zx2c4.com/wireguard | sed -n 's/.*v\([0-9.]*\).*/#define WIREGUARD_GO_VERSION "\1"/p' > "$@"
47+
$(DESTDIR)/wireguard-go-version.h: go.mod $(GOROOT)/.prepared
48+
sed -E -n 's/.*golang\.zx2c4\.com\/wireguard +v[0-9.]+-[0-9]+-([0-9a-f]{8})[0-9a-f]{4}.*/#define WIREGUARD_GO_VERSION "\1"/p' "$<" > "$@"
4749

4850
$(DESTDIR)/libwg-go.a: $(foreach ARCH,$(ARCHS),$(BUILDDIR)/libwg-go-$(ARCH).a)
4951
@mkdir -vp "$(DESTDIR)"

Sources/WireGuardKitGo/api-ios.go renamed to Sources/WireGuardKitGo/api-apple.go

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,41 @@ package main
1414
import "C"
1515

1616
import (
17-
"errors"
18-
"log"
17+
"fmt"
1918
"math"
2019
"os"
2120
"os/signal"
2221
"runtime"
22+
"runtime/debug"
23+
"strings"
2324
"time"
2425
"unsafe"
2526

2627
"golang.org/x/sys/unix"
28+
"golang.zx2c4.com/wireguard/conn"
2729
"golang.zx2c4.com/wireguard/device"
2830
"golang.zx2c4.com/wireguard/tun"
2931
)
3032

3133
var loggerFunc unsafe.Pointer
3234
var loggerCtx unsafe.Pointer
33-
var versionString *C.char
3435

35-
type CLogger struct {
36-
level C.int
36+
type CLogger int
37+
38+
func cstring(s string) *C.char {
39+
b, err := unix.BytePtrFromString(s)
40+
if err != nil {
41+
b := [1]C.char{}
42+
return &b[0]
43+
}
44+
return (*C.char)(unsafe.Pointer(b))
3745
}
3846

39-
func (l *CLogger) Write(p []byte) (int, error) {
47+
func (l CLogger) Printf(format string, args ...interface{}) {
4048
if uintptr(loggerFunc) == 0 {
41-
return 0, errors.New("No logger initialized")
49+
return
4250
}
43-
message := C.CString(string(p))
44-
C.callLogger(loggerFunc, loggerCtx, l.level, message)
45-
C.free(unsafe.Pointer(message))
46-
return len(p), nil
51+
C.callLogger(loggerFunc, loggerCtx, C.int(l), cstring(fmt.Sprintf(format, args...)))
4752
}
4853

4954
type tunnelHandle struct {
@@ -54,7 +59,6 @@ type tunnelHandle struct {
5459
var tunnelHandles = make(map[int32]tunnelHandle)
5560

5661
func init() {
57-
versionString = C.CString(device.WireGuardGoVersion)
5862
signals := make(chan os.Signal)
5963
signal.Notify(signals, unix.SIGUSR2)
6064
go func() {
@@ -81,40 +85,39 @@ func wgSetLogger(context, loggerFn uintptr) {
8185
//export wgTurnOn
8286
func wgTurnOn(settings *C.char, tunFd int32) int32 {
8387
logger := &device.Logger{
84-
Debug: log.New(&CLogger{level: 0}, "", 0),
85-
Info: log.New(&CLogger{level: 1}, "", 0),
86-
Error: log.New(&CLogger{level: 2}, "", 0),
88+
Verbosef: CLogger(0).Printf,
89+
Errorf: CLogger(1).Printf,
8790
}
8891
dupTunFd, err := unix.Dup(int(tunFd))
8992
if err != nil {
90-
logger.Error.Println(err)
93+
logger.Errorf("Unable to dup tun fd: %v", err)
9194
return -1
9295
}
9396

9497
err = unix.SetNonblock(dupTunFd, true)
9598
if err != nil {
96-
logger.Error.Println(err)
99+
logger.Errorf("Unable to set tun fd as non blocking: %v", err)
97100
unix.Close(dupTunFd)
98101
return -1
99102
}
100103
tun, err := tun.CreateTUNFromFile(os.NewFile(uintptr(dupTunFd), "/dev/tun"), 0)
101104
if err != nil {
102-
logger.Error.Println(err)
105+
logger.Errorf("Unable to create new tun device from fd: %v", err)
103106
unix.Close(dupTunFd)
104107
return -1
105108
}
106-
logger.Info.Println("Attaching to interface")
107-
dev := device.NewDevice(tun, logger)
109+
logger.Verbosef("Attaching to interface")
110+
dev := device.NewDevice(tun, conn.NewStdNetBind(), logger)
108111

109112
err = dev.IpcSet(C.GoString(settings))
110113
if err != nil {
111-
logger.Error.Println(err)
114+
logger.Errorf("Unable to set IPC settings: %v", err)
112115
unix.Close(dupTunFd)
113116
return -1
114117
}
115118

116119
dev.Up()
117-
logger.Info.Println("Device started")
120+
logger.Verbosef("Device started")
118121

119122
var i int32
120123
for i = 0; i < math.MaxInt32; i++ {
@@ -148,7 +151,7 @@ func wgSetConfig(tunnelHandle int32, settings *C.char) int64 {
148151
}
149152
err := dev.IpcSet(C.GoString(settings))
150153
if err != nil {
151-
dev.Error.Println(err)
154+
dev.Errorf("Unable to set IPC settings: %v", err)
152155
if ipcErr, ok := err.(*device.IPCError); ok {
153156
return ipcErr.ErrorCode()
154157
}
@@ -183,10 +186,10 @@ func wgBumpSockets(tunnelHandle int32) {
183186
dev.SendKeepalivesToPeersWithCurrentKeypair()
184187
return
185188
}
186-
dev.Error.Printf("Unable to update bind, try %d: %v", i+1, err)
189+
dev.Errorf("Unable to update bind, try %d: %v", i+1, err)
187190
time.Sleep(time.Second / 2)
188191
}
189-
dev.Error.Println("Gave up trying to update bind; tunnel is likely dysfunctional")
192+
dev.Errorf("Gave up trying to update bind; tunnel is likely dysfunctional")
190193
}()
191194
}
192195

@@ -201,7 +204,20 @@ func wgDisableSomeRoamingForBrokenMobileSemantics(tunnelHandle int32) {
201204

202205
//export wgVersion
203206
func wgVersion() *C.char {
204-
return versionString
207+
info, ok := debug.ReadBuildInfo()
208+
if !ok {
209+
return C.CString("unknown")
210+
}
211+
for _, dep := range info.Deps {
212+
if dep.Path == "golang.zx2c4.com/wireguard" {
213+
parts := strings.Split(dep.Version, "-")
214+
if len(parts) == 3 && len(parts[2]) == 12 {
215+
return C.CString(parts[2][:7])
216+
}
217+
return C.CString(dep.Version)
218+
}
219+
}
220+
return C.CString("unknown")
205221
}
206222

207223
func main() {}

Sources/WireGuardKitGo/go.mod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
module golang.zx2c4.com/wireguard/ios
1+
module golang.zx2c4.com/wireguard/apple
22

3-
go 1.15
3+
go 1.16
44

55
require (
6-
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
7-
golang.org/x/net v0.0.0-20201216054612-986b41b23924 // indirect
8-
golang.org/x/sys v0.0.0-20201223074533-0d417f636930
9-
golang.zx2c4.com/wireguard v0.0.20201119-0.20201223215156-09728dc6b340
6+
golang.org/x/sys v0.0.0-20210308170721-88b6017d0656
7+
golang.zx2c4.com/wireguard v0.0.0-20210307162820-f4695db51c39
108
)

Sources/WireGuardKitGo/go.sum

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
2-
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
3-
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
4-
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
5-
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
2+
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g=
3+
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
64
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
7-
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
8-
golang.org/x/net v0.0.0-20201216054612-986b41b23924 h1:QsnDpLLOKwHBBDa8nDws4DYNc/ryVW2vCpxCs09d4PY=
9-
golang.org/x/net v0.0.0-20201216054612-986b41b23924/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
5+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
6+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
107
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
11-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
128
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13-
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
149
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
15-
golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
16-
golang.org/x/sys v0.0.0-20201223074533-0d417f636930 h1:vRgIt+nup/B/BwIS0g2oC0haq0iqbV3ZA+u6+0TlNCo=
17-
golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
10+
golang.org/x/sys v0.0.0-20210305215415-5cdee2b1b5a0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11+
golang.org/x/sys v0.0.0-20210308170721-88b6017d0656 h1:FuBaiPCiXkq4v+JY5JEGPU/HwEZwpVyDbu/KBz9fU+4=
12+
golang.org/x/sys v0.0.0-20210308170721-88b6017d0656/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1813
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
1914
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
2015
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
2116
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
2217
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
23-
golang.zx2c4.com/wireguard v0.0.20201119-0.20201223215156-09728dc6b340 h1:X6jrf2sUEj3n+q2oB/I3C088vQFKREz2UzgVJ8wENtI=
24-
golang.zx2c4.com/wireguard v0.0.20201119-0.20201223215156-09728dc6b340/go.mod h1:ITsWNpkFv78VPB7f8MiyuxeEMcHR4jfxHGCJLPP3GHs=
18+
golang.zx2c4.com/wireguard v0.0.0-20210307162820-f4695db51c39 h1:yv331J9aB1fuvxzneUKsRnWyhwK+aj495rADUXSP7Uk=
19+
golang.zx2c4.com/wireguard v0.0.0-20210307162820-f4695db51c39/go.mod h1:ojGPy+9W6ZSM8anL+xC67fvh8zPQJwA6KpFOHyDWLX4=

Sources/WireGuardKitGo/goruntime-boottime-over-monotonic.diff

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From aa85e0f90c9031ff5be32296e9fed1637a2eceae Mon Sep 17 00:00:00 2001
1+
From 516dc0c15ff1ab781e0677606b5be72919251b3e Mon Sep 17 00:00:00 2001
22
From: "Jason A. Donenfeld" <[email protected]>
33
Date: Wed, 9 Dec 2020 14:07:06 +0100
44
Subject: [PATCH] runtime: use libc_mach_continuous_time in nanotime on Darwin
@@ -18,23 +18,23 @@ Change-Id: Ia3282e8bd86f95ad2b76427063e60a005563f4eb
1818
3 files changed, 3 insertions(+), 3 deletions(-)
1919

2020
diff --git a/src/runtime/sys_darwin.go b/src/runtime/sys_darwin.go
21-
index 06474434c9..6f7ca37122 100644
21+
index 4a3f2fc453..4a69403b32 100644
2222
--- a/src/runtime/sys_darwin.go
2323
+++ b/src/runtime/sys_darwin.go
24-
@@ -469,7 +469,7 @@ func setNonblock(fd int32) {
24+
@@ -440,7 +440,7 @@ func setNonblock(fd int32) {
2525
//go:cgo_import_dynamic libc_usleep usleep "/usr/lib/libSystem.B.dylib"
2626

2727
//go:cgo_import_dynamic libc_mach_timebase_info mach_timebase_info "/usr/lib/libSystem.B.dylib"
2828
-//go:cgo_import_dynamic libc_mach_absolute_time mach_absolute_time "/usr/lib/libSystem.B.dylib"
2929
+//go:cgo_import_dynamic libc_mach_continuous_time mach_continuous_time "/usr/lib/libSystem.B.dylib"
30-
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
30+
//go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
3131
//go:cgo_import_dynamic libc_sigaction sigaction "/usr/lib/libSystem.B.dylib"
3232
//go:cgo_import_dynamic libc_pthread_sigmask pthread_sigmask "/usr/lib/libSystem.B.dylib"
3333
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
34-
index 825852d673..5a8b994fb1 100644
34+
index 630fb5df64..4499c88802 100644
3535
--- a/src/runtime/sys_darwin_amd64.s
3636
+++ b/src/runtime/sys_darwin_amd64.s
37-
@@ -109,7 +109,7 @@ TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$0
37+
@@ -114,7 +114,7 @@ TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$0
3838
PUSHQ BP
3939
MOVQ SP, BP
4040
MOVQ DI, BX
@@ -44,10 +44,10 @@ index 825852d673..5a8b994fb1 100644
4444
MOVL timebase<>+machTimebaseInfo_numer(SB), SI
4545
MOVL timebase<>+machTimebaseInfo_denom(SB), DI // atomic read
4646
diff --git a/src/runtime/sys_darwin_arm64.s b/src/runtime/sys_darwin_arm64.s
47-
index 585d4f2c64..c556d88730 100644
47+
index 96d2ed1076..f046545395 100644
4848
--- a/src/runtime/sys_darwin_arm64.s
4949
+++ b/src/runtime/sys_darwin_arm64.s
50-
@@ -135,7 +135,7 @@ GLOBL timebase<>(SB),NOPTR,$(machTimebaseInfo__size)
50+
@@ -143,7 +143,7 @@ GLOBL timebase<>(SB),NOPTR,$(machTimebaseInfo__size)
5151

5252
TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$40
5353
MOVD R0, R19
@@ -57,5 +57,5 @@ index 585d4f2c64..c556d88730 100644
5757
MOVW timebase<>+machTimebaseInfo_numer(SB), R20
5858
MOVD $timebase<>+machTimebaseInfo_denom(SB), R21
5959
--
60-
2.29.2
60+
2.30.1
6161

Sources/WireGuardNetworkExtension/PacketTunnelProvider.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
109109
extension WireGuardLogLevel {
110110
var osLogLevel: OSLogType {
111111
switch self {
112-
case .debug:
112+
case .verbose:
113113
return .debug
114-
case .info:
115-
return .info
116114
case .error:
117115
return .error
118116
}

0 commit comments

Comments
 (0)