diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-12-17 00:24:39 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-12-17 00:26:00 +0100 |
commit | db4e2915f33aa561fff2401e05319e1b5241fdf8 (patch) | |
tree | af58dd8ef9956a9b8559e2e37ba02ca5f2dec5b5 /Sources/WireGuardKit | |
parent | Kit: PacketTunnelSettingsGenerator: do not require DNS queries if no DNS (diff) | |
download | wireguard-apple-db4e2915f33aa561fff2401e05319e1b5241fdf8.tar.xz wireguard-apple-db4e2915f33aa561fff2401e05319e1b5241fdf8.zip |
Kit: Adapter: do not treat NE settings timeouts as fatal
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>
Diffstat (limited to 'Sources/WireGuardKit')
-rw-r--r-- | Sources/WireGuardKit/WireGuardAdapter.swift | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Sources/WireGuardKit/WireGuardAdapter.swift b/Sources/WireGuardKit/WireGuardAdapter.swift index 6c2e956..16e1b28 100644 --- a/Sources/WireGuardKit/WireGuardAdapter.swift +++ b/Sources/WireGuardKit/WireGuardAdapter.swift @@ -21,9 +21,6 @@ public enum WireGuardAdapterError: Error { /// 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) } @@ -304,7 +301,7 @@ public class WireGuardAdapter { throw WireGuardAdapterError.setNetworkSettings(systemError) } } else { - throw WireGuardAdapterError.setNetworkSettingsTimeout + self.logHandler(.error, "setTunnelNetworkSettings timed out after 5 seconds; proceeding anyway") } } |