From a60b2a37d0d532e5e68f4b919ce2e60e44e089dd Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 22 Dec 2018 15:45:09 +0100 Subject: [PATCH] Retain aggressive socket reestablishment for now This can be reverted once we've done more testing. --- WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift index ca8902f..f33d5f6 100644 --- a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift +++ b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift @@ -113,7 +113,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider { private func pathUpdate(path: Network.NWPath) { guard let handle = wgHandle, let packetTunnelSettingsGenerator = packetTunnelSettingsGenerator else { return } var listenPort: UInt16? - if path.availableInterfaces.isEmpty || lastFirstInterface != path.availableInterfaces.first { + //TODO(zx2c4): Remove the `true` here after extensive testing with network/cell simulations. + if true || path.availableInterfaces.isEmpty || lastFirstInterface != path.availableInterfaces.first { listenPort = wgGetListenPort(handle) lastFirstInterface = path.availableInterfaces.first }