]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
NE: No need for two startTunnel() methods
authorRoopesh Chander <roop@roopc.net>
Wed, 19 Dec 2018 07:40:42 +0000 (13:10 +0530)
committerRoopesh Chander <roop@roopc.net>
Wed, 19 Dec 2018 07:40:42 +0000 (13:10 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift

index 8fd5cad60d40eb356351120620765ba66e84ee75..12a2e4361af677c84db0fb6f77a27954f6290305 100644 (file)
@@ -23,6 +23,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
         networkMonitor?.cancel()
     }
 
+    //swiftlint:disable:next function_body_length
     override func startTunnel(options: [String: NSObject]?, completionHandler startTunnelCompletionHandler: @escaping (Error?) -> Void) {
 
         let activationAttemptId = options?["activationAttemptId"] as? String
@@ -35,11 +36,6 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
                 return
         }
 
-        startTunnel(with: tunnelConfiguration, errorNotifier: errorNotifier, completionHandler: startTunnelCompletionHandler)
-    }
-
-    //swiftlint:disable:next function_body_length
-    func startTunnel(with tunnelConfiguration: TunnelConfiguration, errorNotifier: ErrorNotifier, completionHandler startTunnelCompletionHandler: @escaping (Error?) -> Void) {
         configureLogger()
 
         wg_log(.info, message: "Starting tunnel '\(tunnelConfiguration.interface.name)'")