Lazy WGContext made connection unstable.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
8766750bb8
commit
9bd251fe79
|
@ -19,9 +19,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
var wgHandle: Int32?
|
var wgHandle: Int32?
|
||||||
lazy var wgContext: WireGuardContext? = {
|
var wgContext: WireGuardContext?
|
||||||
return WireGuardContext(packetFlow: self.packetFlow)
|
|
||||||
}()
|
|
||||||
|
|
||||||
// MARK: NEPacketTunnelProvider
|
// MARK: NEPacketTunnelProvider
|
||||||
|
|
||||||
|
@ -42,6 +40,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
configureLogger()
|
configureLogger()
|
||||||
|
wgContext = WireGuardContext(packetFlow: self.packetFlow)
|
||||||
|
|
||||||
let handle = connect(interfaceName: interfaceName, settings: settings)
|
let handle = connect(interfaceName: interfaceName, settings: settings)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue