From: Andrej Mihajlov Date: Wed, 2 Dec 2020 12:43:09 +0000 (+0100) Subject: Packet tunnel: Remove last error in the completion handler given to adapter.stop X-Git-Tag: 1.0.10-18~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2c38702c8dc0821355cf88d3eb413b694a6c560;p=thirdparty%2Fwireguard-apple.git Packet tunnel: Remove last error in the completion handler given to adapter.stop Signed-off-by: Andrej Mihajlov --- diff --git a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift index 94dbbdd..28eb986 100644 --- a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift +++ b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift @@ -77,11 +77,11 @@ class PacketTunnelProvider: NEPacketTunnelProvider { } override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { - ErrorNotifier.removeLastErrorFile() - wg_log(.info, staticMessage: "Stopping tunnel") adapter.stop { error in + ErrorNotifier.removeLastErrorFile() + if let error = error { wg_log(.error, message: "Failed to stop WireGuard adapter: \(error.localizedDescription)") }