Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tentative fix for a crash and connectivity issues #875

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions Sources/NetworkProtection/PacketTunnelProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
// expired. In either case it should be enough to record the manual failures
// for these prerequisited to avoid flooding our metrics.
providerEvents.fire(.tunnelStartOnDemandWithoutAccessToken)
try? await Task.sleep(interval: .seconds(15))
try await Task.sleep(interval: .seconds(15))
} else {
// If the VPN was started manually without the basic prerequisites we always
// want to know as this should not be possible.
Expand Down Expand Up @@ -631,7 +631,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
// We add a delay when the VPN is started by
// on-demand and there's an error, to avoid frenetic ON/OFF
// cycling.
try? await Task.sleep(interval: .seconds(15))
try await Task.sleep(interval: .seconds(15))
}

let errorDescription = (error as? LocalizedError)?.localizedDescription ?? String(describing: error)
Expand Down Expand Up @@ -1297,13 +1297,6 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
connectionStatus = .connected(connectedDate: Date())
}

if !settings.disableRekeying {
guard !isKeyExpired else {
try await rekey()
return
}
}

os_log("🔵 Tunnel interface is %{public}@", log: .networkProtection, type: .info, adapter.interfaceName ?? "unknown")

// These cases only make sense in the context of a connection that had trouble
Expand Down
Loading