The general Network Extension framework is incredibly buggy, and a
timeout when setting the network settings does not necessarily imply
that the whole operation failed. Simply log the condition and move on.
This restores the app's old behavior.
Reported-by: Filipe Mendonça <cfilipem@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
/// Failure to set network settings.
case setNetworkSettings(Error)
- /// Timeout when calling to set network settings.
- case setNetworkSettingsTimeout
-
/// Failure to start WireGuard backend.
case startWireGuardBackend(Int32)
}
throw WireGuardAdapterError.setNetworkSettings(systemError)
}
} else {
- throw WireGuardAdapterError.setNetworkSettingsTimeout
+ self.logHandler(.error, "setTunnelNetworkSettings timed out after 5 seconds; proceeding anyway")
}
}
errorNotifier.notify(PacketTunnelProviderError.couldNotSetNetworkSettings)
completionHandler(PacketTunnelProviderError.couldNotSetNetworkSettings)
- case .setNetworkSettingsTimeout:
- wg_log(.error, message: "Starting tunnel failed with setTunnelNetworkSettings timing out")
- errorNotifier.notify(PacketTunnelProviderError.couldNotSetNetworkSettings)
- completionHandler(PacketTunnelProviderError.couldNotSetNetworkSettings)
-
case .startWireGuardBackend(let errorCode):
wg_log(.error, message: "Starting tunnel failed with wgTurnOn returning \(errorCode)")
errorNotifier.notify(PacketTunnelProviderError.couldNotStartBackend)